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

Dev cli sessions #17623

Merged
merged 7 commits into from
Sep 16, 2024
Merged

Dev cli sessions #17623

merged 7 commits into from
Sep 16, 2024

Conversation

i-davydenko
Copy link
Contributor

@i-davydenko i-davydenko commented Dec 26, 2023

sonic-net/SONiC#1367

Why I did it
Give ability to:

  1. configure limit for active login sessions.
  2. configure ssh-server / serial console autologout timeout
  3. configure sysrq-capabilities (enable / disable)

Work item tracking
Microsoft ADO (number only):

How I did it
Add new service that responsible for serial configuration;
Update existing flows for extended ssh-server configurations in hostcfgd;
Add YANG model to support new configuration.

How to verify it
Which release branch to backport (provide reason below if selected)

Tested branch (Please provide the tested image version)

Description for the changelog
Link to config_db schema for YANG module changes
ssh_server
serial_console

A picture of a cute animal (not mandatory but encouraged)
kitty - Cube
image

Copy link

linux-foundation-easycla bot commented Dec 26, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@i-davydenko i-davydenko force-pushed the dev-cli-sessions branch 2 times, most recently from ea0b9f3 to 9e2bdcf Compare January 10, 2024 22:11
@i-davydenko
Copy link
Contributor Author

Hi @lguohan , Hi @qiluo-msft
Could you please review the changes here and in other related submodules :)

@qiluo-msft qiluo-msft requested a review from liuh-80 March 18, 2024 06:52
@@ -40,6 +45,20 @@ module sonic-ssh-server {
}
}
}
leaf inactivity_timeout {
description "inactivity timeout (in minutes), 0 means no timeout";
default 15;
Copy link
Collaborator

@qiluo-msft qiluo-msft Mar 18, 2024

Choose a reason for hiding this comment

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

15

How do you pick the default value? Is it the linux default behavior in old image without this feature? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@qiluo-msft hi, yes, this is old defaults in sonic

type int32 {
range "0..35000";
}
default 15;
Copy link
Collaborator

@qiluo-msft qiluo-msft Mar 18, 2024

Choose a reason for hiding this comment

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

15

How do you pick the default value? Is it the linux default behavior in old image without this feature? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@qiluo-msft hi, yes, this is old defaults in sonic

@qiluo-msft qiluo-msft requested a review from ganglyu March 18, 2024 06:56
@@ -0,0 +1,37 @@
//filename: sonic-serial-console.yang
module sonic-serial-console {
Copy link
Collaborator

@qiluo-msft qiluo-msft Mar 18, 2024

Choose a reason for hiding this comment

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

module

@ganglyu @wen587 @isabelmsft Please help review the 2 Yang models.

Copy link
Contributor

Choose a reason for hiding this comment

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

@i-davydenko
Can you create separate PR for sonic yang models?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@i-davydenko is there a PR for yang? can you please share?
also please add it to the HLD list of PRs for the feature

Copy link
Collaborator

Choose a reason for hiding this comment

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

This commnet is still active.


leaf sysrq_capabilities {
description "managing SysRq capabilities";
type enumeration {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wen587 done

@qiluo-msft
Copy link
Collaborator

Please reduce the "force-pushed" usage, which invalidated all the previous review status.

qiluo-msft
qiluo-msft previously approved these changes May 15, 2024
@i-davydenko
Copy link
Contributor Author

@qiluo-msft not sure how to handle ms_conflict — MS conflict detect. Could you please advise what should I do?
Do I need to message someone from MS team?

@liat-grozovik
Copy link
Collaborator

liat-grozovik commented May 22, 2024

/azpw run ms_conflict

@i-davydenko
Copy link
Contributor Author

/azpw run ms_conflict

@mssonicbld
Copy link
Collaborator

/AzurePipelines run ms_conflict

Copy link

No pipelines are associated with this pull request.

@i-davydenko
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@i-davydenko
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@i-davydenko
Copy link
Contributor Author

@StormLiangMS,@liushilongbuaa can you help please? What should I do with this ms_conflict run?
PR: #17623 is conflict with MS internal repo

@fastiuk fastiuk closed this May 30, 2024
@fastiuk fastiuk reopened this May 30, 2024
@qiluo-msft qiluo-msft merged commit 367495d into sonic-net:master Sep 16, 2024
22 checks passed
qiluo-msft pushed a commit to sonic-net/sonic-utilities that referenced this pull request Sep 16, 2024
HLD: sonic-net/SONiC#1367

| Module name  | PR  | state | context |
| ------------- | ------------- | ----|-----|
| [sonic-buildimage](https://github.com/sonic-net/sonic-buildimage) | [Dev cli sessions](sonic-net/sonic-buildimage#17623) | ![GitHub issue/pull request detail](https://img.shields.io/github/pulls/detail/state/sonic-net/sonic-buildimage/17623) | ![GitHub pull request check contexts](https://img.shields.io/github/status/contexts/pulls/sonic-net/sonic-buildimage/17623) |
| [sonic-host-services](https://github.com/sonic-net/sonic-host-services)  | [cli-sessions](sonic-net/sonic-host-services#99) | ![GitHub issue/pull request detail](https://img.shields.io/github/pulls/detail/state/sonic-net/sonic-host-services/99) | ![GitHub pull request check contexts](https://img.shields.io/github/status/contexts/pulls/sonic-net/sonic-host-services/99) |
| [sonic-utilities](https://github.com/sonic-net/sonic-utilities)  | [SONIC CLI for CLI-Sessions feature #3175](#3175) | ![GitHub issue/pull request detail](https://img.shields.io/github/pulls/detail/state/sonic-net/sonic-utilities/3175)   | ![GitHub pull request check contexts](https://img.shields.io/github/status/contexts/pulls/sonic-net/sonic-utilities/3175)  |

#### What I did

Implement next commands for CLI-sessions feature:

- config serial-console inactivity-timeout  
- config serial-console sysrq-capabilities
- show serial-console

- config ssh  max-sessions
- config ssh  inactivity-timeout 
- show ssh

#### How I did it
Write handlers in config/main.py for serial-console and ssh commands to cover configuration set;
Write handlers in show/main.py for serial-console and ssh to cover show commands.
#### How to verify it
Manual tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants