added how to disable a user account in user.md

This commit is contained in:
piccihud 2023-09-24 15:44:14 +02:00
parent 3755be662d
commit d796411300
1 changed files with 15 additions and 1 deletions

View File

@ -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/)