SoftLayer Technologies (tm)
Divider Forums Divider Portal Divider SPacer Divider About Divider KnowledgeLayer Divider InnerLayer
 
Knowledgebase Home | Favorites Knowledgebase Home | Favorites
Search the Knowledgebase Browse by Category
How do I manage (add/remove) users in SLES?
Adding a user in SLES can be done the old fashioned method, via useradd, or via YaST.

  • 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.
#


  • useradd
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.
#



Related Articles
Attachments
No attachments were found.
Home | Dedicated | Cloud | Solutions | Services | Facilities | Reseller | Resources | News | About | Specials | Contact | Legal
©2008 SoftLayer Technologies, Inc.