Linux/Unix change user password
Recently I needed to change someone’s password on a server because they forgot it. I forgot the command so looking it up thought you might need it, I did.
Change someone’s password as root
passwd USERNAME |
Recently I needed to change someone’s password on a server because they forgot it. I forgot the command so looking it up thought you might need it, I did.
Change someone’s password as root
passwd USERNAME |
One day a while back I wanted to figure out where all of the accounts were list on the machine. I looked everywhere and finally came across the information and thought I better write it down.
User Account informaton is located:
/etc/passwd
Group names are kept in
/etc/group
I found these commands very useful when adding users and group via the command line.
If you want to add a new user to the system. This is a standard user
adduser username |
Add existing user tony to ftp supplementary/secondary group with usermod command using -a option ~ i.e. add the user to the supplemental group(s). Use only with -G option
usermod -aG www-data tony |
Change existing user tony primary group to www:
usermod -g www tony |
UPDATED
Adding a group is done similarly with this command
addgroup groupname |
Add user to group can also be done like this
adduser username groupname |