mirror of
https://github.com/deadcxap/init_scripts.git
synced 2026-07-02 05:43:40 +03:00
Fix user creation message and secure sudoers file
This commit is contained in:
@@ -151,8 +151,8 @@ EOF"
|
|||||||
}
|
}
|
||||||
|
|
||||||
create_user() {
|
create_user() {
|
||||||
run "Creating user $" bash -c "id '$USERNAME' >/dev/null 2>&1 || adduser --disabled-password --gecos '' '$USERNAME'"
|
run "Creating user $USERNAME" bash -c "id '$USERNAME' >/dev/null 2>&1 || adduser --disabled-password --gecos '' '$USERNAME'"
|
||||||
run "Granting sudo privileges to $USERNAME" bash -c "usermod -aG sudo '$USERNAME' && printf '%s ALL=(ALL) NOPASSWD:ALL\\n' '$USERNAME' >/etc/sudoers.d/90-$USERNAME"
|
run "Granting sudo privileges to $USERNAME" bash -c "usermod -aG sudo '$USERNAME' && printf '%s ALL=(ALL) NOPASSWD:ALL\\n' '$USERNAME' >/etc/sudoers.d/90-$USERNAME && chmod 0440 /etc/sudoers.d/90-$USERNAME"
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_ssh() {
|
configure_ssh() {
|
||||||
|
|||||||
Reference in New Issue
Block a user