# mkdir /root
# chown root:root /root
# chmod 0700 /root
To create a directory called /home/vivek and set permission, type:
# mkdir /home/vivek
# chown vivek:vivek /home/vivek
# chmod 0700 /home/vivek
Try to login as vivek:
# su - vivek
Please note that you may need to adjust directory owner, group, and permissions as per your setup.
Finding more information about the user account
To fetch user account entries from administrative database (/etc/passwd and /etc/group), enter:$ getent passwd vivek
Sample outputs:
vivek:x:1000:1000:Vivek Gite,,,:/home/vivek:/bin/bashWhere,
- vivek: Login name / username
- x : Password: An x character indicates that encrypted password is stored in /etc/shadow file.
- 1000: User ID (UID)
- 1000: The primary group ID (stored in /etc/group file)
- Vivek Gite: The comment field. It allow you to add extra information about the users such as user's full name, phone number etc. This field use by finger command.
- /home/vivek: Home directory
- /bin/bash: The absolute path of a command or shell (/bin/bash)
$ getent group vivek
Sample outputs:
vivek:x:1000:
Tidak ada komentar:
Posting Komentar