User Management and File/Directory Permission in Linux

Ravindra Rana
2 min readMay 16, 2020
Ranatharu Homestay, Kanchanpur Nepal

Linux is a Multi-User Operating System that means we could work on multiple users at the same time.

So we need to user management in Linux that refers to which file or directory belongs to whom.

In User Management the very first step is to create a user, so let’s create a user in Linux through this command.

$sudo useradd username

If you want to check the user is created or not then type this command in terminal

$cat /etc/passwd

After this, you have to set a password for that user so type this command

$sudo passwd username

Now it’s time switch user which you have created, type this command in terminal.

$sudo su dorje

Command to display files/Directories

$ls -l

Create a file with this command

$sudo touch filename

Create Directory/Folder

$sudo mkdir foldername

Change Ownership of File/Directory

$sudo chown -R dorje linuxworkspace

After the above command

How to recognize the file and Directory?

If permission level, see in the first column of the above picture the directory are started with ‘d’ and files are started with ‘-’ sign.

For example, the last picture having drwxr-xr-x is a directory and the above item is a file.

--

--