Search the Knowledgebase |
Browse by Category |
|
|
|
|
|
| How do I manage (add/remove) users in SLES? |
|
Thank you for rating this answer.
|
Adding a user in SLES can be done the old fashioned method, via useradd, or via YaST.
Using YaST we can add the user in a very verbose way. Each option is quite easy to understand.
# yast2 users add help
YaST Configuration Module users --------------------------------
Command 'add' Add new user
Options: username [string] Login name of the user uid [string] UID of the user cn [string] Full name of the user password [string] Password of the user home [string] Home directory of the user no_home Do not create home directory for new user shell [string] Login shell of the user gid [string] GID of user's default group grouplist [string] List of groups of which the user is a member (separated by commas) type [string] Type of the user (local, system, nis, ldap) ldap_password [string] Password for LDAP server help Print the help for this command verbose Show progress information
#
So with that we can add a user named 'admin' in the wheel group. The gid=100 places the user into the default local group of 'users'
# yast2 users add username=admin cn="My Admin User" password="This_Is_The_Password123@" gid=100 grouplist=wheel type=local #
Now we can review the new users configuration. We can see that the default home and shell were automatically used when creating the user:
# yast2 users show username=admin Full Name: My Admin User List of Groups: wheel Default Group: users Home Directory: /home/admin Login Shell: /bin/bash Login Name: admin UID: 1000 # id admin uid=1000(admin) gid=100(users) groups=100(users),10(wheel) #
And remove the user:
# yast2 users delete username=admin # yast2 users show username=admin There is no such user. #
The useradd command is almost as simple to use, but requires an additional step.
# useradd -g users -m -c "My Admin User" admin # passwd admin Changing password for admin. New Password: Reenter New Password: Password changed. #
|
| Attachments |
|
No attachments were found.
|