Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 7e3b1fb4 authored by Robert Nelson's avatar Robert Nelson
Browse files

stretch: rework sudo


Signed-off-by: default avatarRobert Nelson <robertcnelson@gmail.com>
parent 2cc61fa5
No related merge requests found
...@@ -813,8 +813,14 @@ cat > "${DIR}/chroot_script.sh" <<-__EOF__ ...@@ -813,8 +813,14 @@ cat > "${DIR}/chroot_script.sh" <<-__EOF__
dpkg_check dpkg_check
if [ "x\${pkg_is_not_installed}" = "x" ] ; then if [ "x\${pkg_is_not_installed}" = "x" ] ; then
echo "Log: (chroot) adding admin group to /etc/sudoers" if [ -f /etc/sudoers.d/README ] ; then
echo "%admin ALL=(ALL) ALL" >>/etc/sudoers echo "Log: (chroot) adding admin group to /etc/sudoers.d/admin"
echo "%admin ALL=(ALL:ALL) ALL" >/etc/sudoers.d/admin
chmod 0440 /etc/sudoers.d/admin
else
echo "Log: (chroot) adding admin group to /etc/sudoers"
echo "%admin ALL=(ALL) ALL" >>/etc/sudoers
fi
else else
dpkg_package_missing dpkg_package_missing
if [ "x${rfs_disable_root}" = "xenable" ] ; then if [ "x${rfs_disable_root}" = "xenable" ] ; then
......
...@@ -357,9 +357,10 @@ unsecure_root () { ...@@ -357,9 +357,10 @@ unsecure_root () {
sed -i -e 's:PermitRootLogin without-password:PermitRootLogin yes:g' /etc/ssh/sshd_config sed -i -e 's:PermitRootLogin without-password:PermitRootLogin yes:g' /etc/ssh/sshd_config
fi fi
if [ -f /etc/sudoers ] ; then if [ -d /etc/sudoers.d/ ] ; then
#Don't require password for sudo access #Don't require password for sudo access
echo "${rfs_username} ALL=NOPASSWD: ALL" >>/etc/sudoers echo "${rfs_username} ALL=NOPASSWD: ALL" >/etc/sudoers.d/${rfs_username}
chmod 0440 /etc/sudoers.d/${rfs_username}
fi fi
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment