Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ssh configurations to YANG model #13338

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
43525e5
Implemented ssh configurations
ycoheNvidia Jan 9, 2023
7b0ec56
modified sonic host services pointer
ycoheNvidia Jan 9, 2023
fdc96bd
Merge branch 'sonic-net:master' into sonic-buildimage-ycoheNvidia-ssh…
ycoheNvidia Jan 9, 2023
cb4bed9
removed debug link
ycoheNvidia Jan 12, 2023
bf95354
added ssh-server yang model tests
ycoheNvidia Feb 20, 2023
3c3738a
minor yang model fix
ycoheNvidia Feb 20, 2023
890b367
Merge branch 'master' into sonic-buildimage-ssh_config
ycoheNvidia Mar 6, 2023
8a8ce2a
Merge branch 'sonic-net:master' into sonic-buildimage-ssh_config
ycoheNvidia Mar 6, 2023
2856e65
added ssh yang to setup
ycoheNvidia Mar 6, 2023
a4422b2
Update sonic-ssh-server.yang
ycoheNvidia Mar 9, 2023
50691a3
Added ssh-server table to Configurations.md
ycoheNvidia Mar 30, 2023
03be592
Merge branch 'master' into sonic-buildimage-ssh_config
ycoheNvidia Apr 30, 2023
1741ccc
Merge branch 'master' into sonic-buildimage-ssh_config
ycoheNvidia May 17, 2023
daf7c4a
Update Configuration.md
ycoheNvidia May 21, 2023
1c0a946
Merge branch 'master' into sonic-buildimage-ssh_config
ycoheNvidia May 21, 2023
7afff88
Fixing Configuration.md line ending
ycoheNvidia May 21, 2023
9d368c9
Merge branch 'master' into sonic-buildimage-ssh_config
ycoheNvidia May 30, 2023
9318bf4
Merge branch 'sonic-net:master' into sonic-buildimage-ssh_config
ycoheNvidia Jun 26, 2023
51c1370
Fixed minor issues raised in review
ycoheNvidia Jun 26, 2023
2a0c0c4
fixed tab issues
ycoheNvidia Jul 9, 2023
fe60125
Merge branch 'sonic-net:master' into sonic-buildimage-ssh_config
ycoheNvidia Jul 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
url = https://github.com/sonic-net/sonic-dhcp-relay.git
[submodule "src/sonic-host-services"]
path = src/sonic-host-services
url = https://github.com/sonic-net/sonic-host-services
url = https://github.com/ycoheNvidia/sonic-host-services
ycoheNvidia marked this conversation as resolved.
Show resolved Hide resolved
branch = sonic-host-services-ycoheNvidia-ssh_config
[submodule "src/sonic-gnmi"]
path = src/sonic-gnmi
url = https://github.com/sonic-net/sonic-gnmi.git
Expand Down
7 changes: 7 additions & 0 deletions files/build_templates/init_cfg.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,12 @@
"digits_class": "true",
"special_class": "true"
}
},
"SSH_SERVER": {
ycoheNvidia marked this conversation as resolved.
Show resolved Hide resolved
"POLICIES":{
"authentication_retries": "6",
"login_timeout": "120",
"ports": "22"
}
}
}
45 changes: 45 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-ssh-server.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

//filename: sonic-ssh_server.yang
ycoheNvidia marked this conversation as resolved.
Show resolved Hide resolved
module sonic-sshg {
yang-version 1.1;
namespace "http://github.com/Azure/sonic-ssh_global";
ycoheNvidia marked this conversation as resolved.
Show resolved Hide resolved
prefix sshg;

description "SSH SERVER CONFIG YANG Module for SONiC OS";

revision 2022-08-29 {
ycoheNvidia marked this conversation as resolved.
Show resolved Hide resolved
description
"First Revision";
}

container sonic-ssh_server {
container SSH_SERVER {
description "SSH SERVER CONFIG part of config_db.json";
container POLICIES {
leaf authentication_retries {
description "number of login attepmts";
default 6;
type uint8 {
range 1..100;
}
}
leaf login_timeout {
description "login timeout (secs unit)";
default 120;
type uint32 {
range 1..600;
}
}
leaf ports {
description "ssh port numbers";
ycoheNvidia marked this conversation as resolved.
Show resolved Hide resolved
type string {
ycoheNvidia marked this conversation as resolved.
Show resolved Hide resolved
pattern '[0-9]+(,[0-9]+)*' {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any limit to the number of ports that can be defined?

Copy link
Contributor Author

@ycoheNvidia ycoheNvidia Mar 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no limit that I am aware of (at least not in openSSH)

error-message "Invalid port numbers value";
error-app-tag ssh-server-ports-invalid-value;
}
}
}
}/*container policies */
} /* container SSH_SERVER */
}/* container sonic-sshg */
}/* end of module sonic-sshg */