SSH: Add option to enable sudo for ssh user.

- Disable root login

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
Tobias K 2023-01-05 02:07:46 +01:00 committed by Tobias Knöppler
parent bd835dcd82
commit 8149493439
No known key found for this signature in database
GPG Key ID: 3510056072886A8F
3 changed files with 12 additions and 0 deletions

View File

@ -41,6 +41,11 @@ configure()
# Reenable pi user
chsh -s /bin/bash "$USER"
[[ "$SUDO" == "yes" ]] && {
usermod -aG sudo "$USER"
echo "Enabled sudo for $USER"
}
# Check for insecure default pi password ( taken from old jessie method )
# TODO Due to Debian bug #1003151 with mkpasswd this feature is not working properly at the moment - https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1837456.html
#local SHADOW SALT HASH

View File

@ -29,6 +29,12 @@
"name": "Confirm",
"value": "1234",
"type": "password"
},
{
"id": "SUDO",
"name": "Enable sudo",
"value": "no",
"type": "bool"
}
]
}

1
ncp.sh
View File

@ -132,6 +132,7 @@ EOF
id -u "$WEBADMIN" &>/dev/null || useradd --home-dir /nonexistent "$WEBADMIN"
echo -e "$WEBPASSWD\n$WEBPASSWD" | passwd "$WEBADMIN"
chsh -s /usr/sbin/nologin "$WEBADMIN"
chsh -s /usr/sbin/nologin root
## NCP LAUNCHER
mkdir -p /home/www