From b745c0bf1b50ed91e64109ab11514a3f8e60c3e3 Mon Sep 17 00:00:00 2001 From: Taoyu Li Date: Thu, 21 Jun 2018 10:41:50 -0700 Subject: [PATCH] Modify sudo lecture message to be more informational (#1800) --- files/build_templates/sonic_debian_extension.j2 | 1 + files/image_config/sudoers/sudoers | 1 + files/image_config/sudoers/sudoers.lecture | 4 ++++ 3 files changed, 6 insertions(+) create mode 100644 files/image_config/sudoers/sudoers.lecture diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index d0afa4659667..698a29ec22a7 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -179,6 +179,7 @@ sudo cp $IMAGE_CONFIGS/asn/deployment_id_asn_map.yml $FILESYSTEM_ROOT/etc/sonic/ # Copy sudoers configuration file sudo cp $IMAGE_CONFIGS/sudoers/sudoers $FILESYSTEM_ROOT/etc/ +sudo cp $IMAGE_CONFIGS/sudoers/sudoers.lecture $FILESYSTEM_ROOT/etc/ # Copy control plane ACL management daemon files sudo cp $IMAGE_CONFIGS/caclmgrd/caclmgrd.service $FILESYSTEM_ROOT/etc/systemd/system/ diff --git a/files/image_config/sudoers/sudoers b/files/image_config/sudoers/sudoers index 4d651957afe2..66ca00f9de95 100644 --- a/files/image_config/sudoers/sudoers +++ b/files/image_config/sudoers/sudoers @@ -10,6 +10,7 @@ Defaults env_reset #Defaults mail_badpass Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" Defaults env_keep += "VTYSH_PAGER" +Defaults lecture_file = /etc/sudoers.lecture # Host alias specification diff --git a/files/image_config/sudoers/sudoers.lecture b/files/image_config/sudoers/sudoers.lecture new file mode 100644 index 000000000000..e89340092c70 --- /dev/null +++ b/files/image_config/sudoers/sudoers.lecture @@ -0,0 +1,4 @@ + +Make sure your account has RW permission to current device. +Otherwise sudo requests will be rejected. +