dEEpEst
☣☣ In The Depths ☣☣
Staff member
Administrator
Super Moderator
Hacker
Specter
Crawler
Shadow
- Joined
- Mar 29, 2018
- Messages
- 13,861
- Solutions
- 4
- Reputation
- 32
- Reaction score
- 45,552
- Points
- 1,813
- Credits
- 55,350
7 Years of Service
56%
How to change passwords?
To change or create a password in Linux, use the passwd command. If the user does not have root rights, then he will be able to change only his own password. If he is privileged, then he will be able to change for different users.
Changing your own password:
Bash:
$ passwd
Changing password for vitek
current password:
Enter new password:
Retype new password:
Now let's imagine that our system is being used by a figurative "Vasek" who has forgotten his password. We, as an admin, can create a new password for "Vasya" and let him into the system:
Bash:
$ sudo passwd vasya
New password:
Retype new password:
That's it, we can tell Vasya the password and let him use the system:
Bash:
$ su - vasya
Password:
vasya@ubuntu-desktop:~$
And if we, as an admin, notice that the user has a weak password, we can forcibly make it invalid and force the user to update the data at the next login attempt. To do this, add the "-e" flag:
Bash:
$ sudo passwd -e vasya
$ sudo su - vasya
You are required to change your password immediately...
Changing password for vasya.
Current password:
New password:
Retype new password: