All About User in Ubuntu

Linux, Ubuntu, 2016-01-26 07:13:46 UTC

1. Add User

$ sudo add user <user_name>

 

2. Add User to Group

$ sudo usermod -a -G <ExistingGroupName> <ExistingUserName>

 

3. Change user password

$ sudo passwd <username>

 

4. Deny user login via ssh

Please refer to this http://develbook.com/prevent-users-sign-in-via-ssh

 

5. List all of users

$ cut -d: -f1 /etc/passwd

 

6. Delete a user

$ sudo userdel username

Don't forget to delete user folder

$ sudo rm -r /home/username

 

7. Display group members

$ members <GroupName>

*) You must have member application on your server. If you don't have just sudo apt-get install members


Share: