add user running script to ssh group

This commit is contained in:
Aaron Murray 2020-10-02 08:31:30 -05:00
parent ec2f30b217
commit 7bfd864a47

11
install
View File

@ -13,7 +13,7 @@
# https://github.com/armbian/config/blob/master/debian-software # https://github.com/armbian/config/blob/master/debian-software
# https://forum.openmediavault.org/index.php/Thread/25062-Install-OMV5-on-Debian-10-Buster/ # https://forum.openmediavault.org/index.php/Thread/25062-Install-OMV5-on-Debian-10-Buster/
# #
# version: 1.2.7 # version: 1.2.8
# #
if [[ $(id -u) -ne 0 ]]; then if [[ $(id -u) -ne 0 ]]; then
@ -401,11 +401,20 @@ cat << EOF > ${ioniceCron}
EOF EOF
chmod 600 ${ioniceCron} chmod 600 ${ioniceCron}
# add pi user to ssh group if it exists
if getent passwd pi > /dev/null; then if getent passwd pi > /dev/null; then
echo "Adding pi user to ssh group ..." echo "Adding pi user to ssh group ..."
usermod -a -G ssh pi usermod -a -G ssh pi
fi fi
# add user running the script to ssh group if not pi or root
if [ -n "${USER}" ] && [ ! "${USER}" = "root" ] && [ ! "${USER}" = "pi" ]; then
if getent passwd ${USER} > /dev/null; then
echo "Adding ${USER} to the ssh group ..."
usermod -a -G ssh ${USER}
fi
fi
# remove networkmanager and dhcpcd5 then configure networkd # remove networkmanager and dhcpcd5 then configure networkd
if [ ${version} -gt 4 ] && [ ${skipNet} -ne 1 ]; then if [ ${version} -gt 4 ] && [ ${skipNet} -ne 1 ]; then