From d796411300e6e23ddfd4e622fdebc555e8869eb7 Mon Sep 17 00:00:00 2001 From: piccihud Date: Sun, 24 Sep 2023 15:44:14 +0200 Subject: [PATCH] added how to disable a user account in user.md --- linux/user/users.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/linux/user/users.md b/linux/user/users.md index 99ccf7d..36a22d4 100644 --- a/linux/user/users.md +++ b/linux/user/users.md @@ -69,6 +69,20 @@ In questo modo l'utente non potrà più accedere al sistema. L'opzione `-E` viene utilizzata per impostare una data di scadenza. Quindi, una volta eseguito il comando, l'account verrà bloccato immediatamente. +#### Disabilitare l'account + +```bash +sudo usermod -L testuser + +# or + +sudo passwd -l testuser + +# or + +sudo usermod -s /sbin/nologin [username] +``` + #### Forzare il cambio password ```bash @@ -82,7 +96,6 @@ sudo chage -E 2023-01-11 sagar #### Impostare una data di scadenza della password - ```bash sudo chage -d YYYY-MM-GG nome_utente ``` @@ -113,3 +126,4 @@ sudo deluser --remove-home eric - [https://www.howtogeek.com/656549/how-to-delete-a-user-on-linux-and-remove-every-trace/](https://www.howtogeek.com/656549/how-to-delete-a-user-on-linux-and-remove-every-trace/) - [https://linuxhandbook.com/chage-command/](https://linuxhandbook.com/chage-command/) - [https://www.howtogeek.com/50787/add-a-user-to-a-group-or-second-group-on-linux/](https://www.howtogeek.com/50787/add-a-user-to-a-group-or-second-group-on-linux/) +- [https://www.thegeekdiary.com/unix-linux-how-to-lock-or-disable-an-user-account/](https://www.thegeekdiary.com/unix-linux-how-to-lock-or-disable-an-user-account/)