Skip to content

Conversation

manoharan-nexthop
Copy link

@manoharan-nexthop manoharan-nexthop commented Sep 8, 2025

What I did

This implementation addresses the User Management HLD requirements for user administration in SONiC. sonic-net/SONiC#2018

Add CLI interface for SONiC local user management:

  • config user add/modify/delete - User lifecycle management
  • config user add-ssh-key/remove-ssh-key - SSH key management
  • config user import-existing - Import system users to SONiC
  • show user [username] - Display user information and status
  • show user roles - Display available roles and permissions

How I did it

Features:

  • Role-based access control (administrator/operator)
  • Secure password handling with confirmation prompts
  • SSH key format validation and management
  • CONFIG_DB integration for persistent configuration
  • Comprehensive input validation and error handling
  • Complete test suite with unit and integration tests

Commands integrate with userd daemon for system-level user operations.

How to verify it

Validated the CLI and its functionality.

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@aidan-gallagher
Copy link

I think you have accidentally pushed your code for sonic-host-services instead of sonic-utilities with your most recent force push (from c4ad7ec to c1b2c4b).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@manoharan-nexthop
Copy link
Author

I think you have accidentally pushed your code for sonic-host-services instead of sonic-utilities with your most recent force push (from c4ad7ec to c1b2c4b).

Thanks, have upated the branch.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link

@spandan-nexthop spandan-nexthop left a comment

Choose a reason for hiding this comment

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

LGTM

Add comprehensive CLI interface for SONiC local user management:

- config user add/modify/delete - User lifecycle management
- config user add-ssh-key/remove-ssh-key - SSH key management
- config user import-existing - Import system users to SONiC
- show user [username] - Display user information and status
- show user roles - Display available roles and permissions

Features:
- Role-based access control (administrator/operator)
- Secure password handling with confirmation prompts
- SSH key format validation and management
- CONFIG_DB integration for persistent configuration
- Comprehensive input validation and error handling
- Complete test suite with unit and integration tests

Commands integrate with userd daemon for system-level user operations.
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

4 participants