How to create Linux user

Posted on ខែ ធ្នូ 6, 2007. Filed under: 1 |

Today there is an interesting to learn on how to create users. In openSUSE, normally we can create a user easily by using Yast and if you prefer to experience with command you can also use two commands to have a proper user with:

#useradd -m newuser
#passwd newuser

The second command will prompt you to enter new password of user. Then you can log in both graphic and text mode.
On the other way if you know how things work you can also do it manually. When you type useradd it will write the new user data into /etc/passwd and with -m of the command it copy folder skel from /etc/skel into /home and then rename it with the name of new user created. After that change ownership of the folder into the new one. So how to do this?

- Log in as root

———————————————
>su
———————————————
- Type root’s password

———————————————
#vi /etc/passwd
———————————————

- enter the newline of a new user to create with similar fields of existing user example

- newuser:x:1008:100::/home/newuser:/bin/bash

- then save it by pressing esc, type : x

- After leave vi you have to copy the directory skel into /home

———————————–
#cp -r /etc/skel /home
———————————–

- rename folder skel to the username

———————————————-
#mv skel newuser
———————————————-

- Change ownership and group membership of the directory

———————————————–
#chown -R newuser.users newuser /home/newuser
———————————————–

- Add password to the user

———————————————-
#passwd newuser
———————————————-
- Type password for newuser

- Log out

- Log in with the new user and password

Congratulation you can create user!

Make a Comment

Make a Comment: ( None so far )

blockquote and a tags work here.

Liked it here?
Why not try sites on the blogroll...