Linux Commands privileges

I have explained the command types in last blog .  Here we will discuss further the  other  essential elements of the Linux host.

One of the important command was type to get path related information . Another one was export to create/modify any environment variable.

How to create/modify a file from CLI One can use any editor vi, vim (vImproved), nano etc for normal user file but use vipw, vigr, visudo for corresponding root files and sudoedit for any other root specific file.

This is required to avoid any corruption or wrong data in these root specific configuration files. vipw -s and vigr -s should be used to update corresponding encrypted passwords in /etc/shadow , /etc/gshadow . /etc/passwd keeps user account information such as username, user ID, group ID etc.

Could you try to find location of the utilities(vipw etc) mentioned above using type command ?  -}

One of the basic requirement is to provide SUDO permission to the existing user so that further customization of the system can be done. Please note that sudo gives you additional privileges use it carefully. 

How to set SUDO permission for a user ? Only root or someone with similar privileges can add a user to sudoers’ list

/etc/sudoers entry :

<user list> <host list> = <operator list> <tag list> <command list>

The first part is the user,  the second part is a list of hostnames on which this sudo entry will be effective, the third part is which users(Groups) he may act as, sudoer and the last one, is which commands he may run when using sudo

Users and Groups :  You may think of different departments like Finance, HR, Sales based groups. All the files from one department will not be accessible by other. Somewhat similar to whatsapp groups and members.

Q: Can you add/modify user or group without adduser command ?

Ans: Yes. You can use  vipw,vigr and passwd commands. You need to create user home directory manually using mkdir and change access permissions.

File Metadata : Data of file data  i.e concept of inode

ls -il

Soft/Symbolic Link vs Hard Link :

Soft link is similar to shortcut in Windows. If you delete the original file, shortcut will not work. However hard link means , creating another filename with the same inode. Any restriction on creating hard link ?

mv command create hardlink if both source and destination are in the same filesystem . Otherwise it will copy the contents.

Analyze file names related to mytest2 in both the screenshots given below to understand the hard and soft link ,

linux7

In the following screen mytest2 was created using cp, mytest2link using ln and mytest2symlink using ln -s commands.

Could you check help of ln command ?

Thanks. I am trying to improve usability of my  site. Did you find this discussion helpful ? If so,  Please subscribe to YouTube channel Embedkari for further detail.

Exit mobile version