Day-3: Linux user management and permissions

use sudo command to see some confidential or root user access file:

$ cat /var/etc/shadow [you cant see access denied]
$ sudo cat /var/etc/shadow [noew you can see]
$ sudo cat /var/etc/passwd
$ sudo cat /var/etc/group

add so…


This content originally appeared on DEV Community and was authored by Mahbub Ferdous Bijoy

  1. use sudo command to see some confidential or root user access file:
$ cat /var/etc/shadow         [you cant see access denied]
$ sudo cat /var/etc/shadow        [noew you can see]
$ sudo cat /var/etc/passwd
$ sudo cat /var/etc/group

  1. add some user by using useradd command:
$ sudo useradd userName

  1. delete some user by using userdel command:
$ sudo userdel userName

  1. cahnging some user password :
$ sudo passwd userName

  1. if we want to know our ssh key :
$ cat ~/.ssh/id_rsa.pub

  1. connect your machine with remote machine via ssh :
$ ssh -i "key-pair_fileName_PATH ubuntu@ip_address    [ubuntu or any os]

  1. something copy from remote server:
$ scp -i <keypair_PATH> < keypair_PATH> <user@ip_address>: filePath 

here all linux permission command:

  1. check file permission:
$ ls -l

  1. to change any file permission by using chmod(rwx):
$ chmod +x fileName            [make executable file]
$ chmod +rwx fileName          [ make permission read,write, executable]
$ chmod -rwx fileName          [ remove all permission]
$ chmod -x fileName            [remove executable permission]

  1. we can give permission by using numaric command like 777:
Description: for read - 4, write - 2, execute -1. all together 7. for 777 means 1st 7 for user, 2nd for group and 3rd for all user

$ chmod 777 fileName    [all permission for user,group and all]
$ chmod 742 fileName    [all permission for user, read for group, write for all]
$ chmod 124 fileName    [execute permission for user, write for group, read for all]
$ chmod 711 fileName    [ all permission for user, execute for groups and all]

  1. modifying ownership permission :
$ sudo chown userName fileName    [it will change files user ownership]
$ sudo chgrp groupName fileName    [it will change files group ownership]
$ sudo chmod userName:groupName fileName     [it will change both user & group ownership]

  1. if you want to change your user password:
$ passwd

  1. to see our system name :
$ uname

  1. to see our system name and details:
$ uname -a
$ uname -r     [to check only version numaric ]

  1. add a user to a group :
$ sudo usermod -a -g groupName userName

  1. remove a user from a group:
$ sudo deluser userName groupName

  1. Shows information of all the users logged in:
$ finger

  1. show information of a particular user:
$ finger userName


This content originally appeared on DEV Community and was authored by Mahbub Ferdous Bijoy


Print Share Comment Cite Upload Translate Updates
APA

Mahbub Ferdous Bijoy | Sciencx (2024-09-30T16:48:59+00:00) Day-3: Linux user management and permissions. Retrieved from https://www.scien.cx/2024/09/30/day-3-linux-user-management-and-permissions/

MLA
" » Day-3: Linux user management and permissions." Mahbub Ferdous Bijoy | Sciencx - Monday September 30, 2024, https://www.scien.cx/2024/09/30/day-3-linux-user-management-and-permissions/
HARVARD
Mahbub Ferdous Bijoy | Sciencx Monday September 30, 2024 » Day-3: Linux user management and permissions., viewed ,<https://www.scien.cx/2024/09/30/day-3-linux-user-management-and-permissions/>
VANCOUVER
Mahbub Ferdous Bijoy | Sciencx - » Day-3: Linux user management and permissions. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/09/30/day-3-linux-user-management-and-permissions/
CHICAGO
" » Day-3: Linux user management and permissions." Mahbub Ferdous Bijoy | Sciencx - Accessed . https://www.scien.cx/2024/09/30/day-3-linux-user-management-and-permissions/
IEEE
" » Day-3: Linux user management and permissions." Mahbub Ferdous Bijoy | Sciencx [Online]. Available: https://www.scien.cx/2024/09/30/day-3-linux-user-management-and-permissions/. [Accessed: ]
rf:citation
» Day-3: Linux user management and permissions | Mahbub Ferdous Bijoy | Sciencx | https://www.scien.cx/2024/09/30/day-3-linux-user-management-and-permissions/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.