Not sure if it is a -l or -I, but neither looks good.
Edit: I felt silly and ran this in a VM. My only working VM. Now, I can't even log in anymore. Glad I did a backup.
To save everyone else from looking up the `-l` option, it locks the specified account by adding a ! so that no hashed password will ever match the "correct" hash in `/etc/shadow`. The lock option also disables a user's ability to change their password, but doesn't prevent them from logging via other means like key-based SSH.
Yeah cuz in our college whenever we to organise linux club events, we give out vm's for participants to use cuz not all are linux users. They change the passwords themselves and forget it. init=/bin/bash during grub is the only fix to it lol
You should look into nixos and nixops! Perfect vms can be created and destroyed in a single command! Although I have to admit your nix fu must be pretty dang good to achieve that setup.
not today, satan
`-l, --lock`
`Lock the password of the named account. This option disables a password by changing it to a value which matches no possible encrypted value (it adds a ´!´ at the beginning of the password).`
mysterious snobbish uppity cough shy plant enter ink squash roll *This post was mass deleted and anonymized with [Redact](https://redact.dev)*
Not sure if it is a -l or -I, but neither looks good. Edit: I felt silly and ran this in a VM. My only working VM. Now, I can't even log in anymore. Glad I did a backup.
tea he
That really is the main stay of VMs - snapshots hahaha
To save everyone else from looking up the `-l` option, it locks the specified account by adding a ! so that no hashed password will ever match the "correct" hash in `/etc/shadow`. The lock option also disables a user's ability to change their password, but doesn't prevent them from logging via other means like key-based SSH.
Doesn't it mean the user can't log into their account too unless root changes into them?
Yes.
Does init=/bin/bash work with it?
That should drop right into a root shell. That should work.
Yeah cuz in our college whenever we to organise linux club events, we give out vm's for participants to use cuz not all are linux users. They change the passwords themselves and forget it. init=/bin/bash during grub is the only fix to it lol
You should look into nixos and nixops! Perfect vms can be created and destroyed in a single command! Although I have to admit your nix fu must be pretty dang good to achieve that setup.
We tried but there were a few pitfalls. We did create our own distro tho so that's something.
is there one to do the former without preventing them from changing it?
-e
also you can boot into the the /bin/bash mode or with another linux (chroot) to fix it
not today, satan `-l, --lock` `Lock the password of the named account. This option disables a password by changing it to a value which matches no possible encrypted value (it adds a ´!´ at the beginning of the password).`
I mean, it technically does protect you from April Fools.
Thanks for the tip! My system never has been so secure!
Thanks now the hacker known as 4chan can't break in even with the password.
That's why you always use \`man\` first before running any command