Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
# Launch the "preferred" shell based on the groups that the user belongs to.
# The preferred shell is either:
# /bin/bash: If the user belongs to group "admin"
# /usr/bin/sonic-cli: Otherwise

# Uncomment "set -x" for debugging
#set -x

if /usr/bin/id -Gn | tr " " "\n" | /bin/grep -qw "^admin$"; then
exec /bin/bash "$@"
else
exec /usr/bin/sonic-cli
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Current sonic-cli does not provide all commands supported, like the Click commands. Hence, it is not a good idea to launch sonic-cli for remote user. Instead, bash shall be launched where the user can perform CRUD operations via Click commands.

Also, for TACACS, bash is being launched now. Hence to maintain consistency across all remote users, we shall retain TACACS shell launch behavior for RADIUS too.

#13141 addressing the proper approach.

fi
1 change: 1 addition & 0 deletions rules/docker-sonic-mgmt-framework.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -v /var/run/dbus:/var/run/dbus:rw
$(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += --mount type=bind,source="/var/platform/",target="/mnt/platform/"

$(DOCKER_MGMT_FRAMEWORK)_BASE_IMAGE_FILES += sonic-cli:/usr/bin/sonic-cli
$(DOCKER_MGMT_FRAMEWORK)_BASE_IMAGE_FILES += sonic-launch-shell:/usr/bin/sonic-launch-shell

SONIC_BUSTER_DOCKERS += $(DOCKER_MGMT_FRAMEWORK)
SONIC_BUSTER_DBG_DOCKERS += $(DOCKER_MGMT_FRAMEWORK_DBG)