Users and Files Management Commands
uname:- It just prints the core operating system name.
uptime:- It is used to find out how long the system is active (running).
who:- This command is a simple and effective way to display information about currently logged-in users.
which:- This is used to locate the executable file associated with the given command by searching it in the path environment variable.
id:- This is used to print the genuine and effective user ID and group ID.
sudo:- This is generally used as a prefix for some commands that only superusers are allowed to run. If you prefix any command with “sudo”, it will run that command with elevated privileges or in other words allow a user with proper permissions to execute a command as another user, such as the superuser.
shutdown:- It is used to shutdown the system in a safe way.
apt:- This is a powerful command-line tool, which works with Ubuntu's Advanced Packaging Tool (APT). The commands contained within apt provide the means for installing new software packages, upgrading existing software packages, updating the package list index, and even upgrading the entire Ubuntu system.
Users and Group Management Commands
whoami:- The ‘whoami’ command is a simple yet powerful utility designed to reveal the current username associated with the active user session.
useradd:- That is used to add user accounts to your system.
-
passwd:- The passwd command sets and changes passwords for users.
su:- The 'su' is the abbreviation for “Switch User”. The su command is a command-line-based utility in Linux based operating system that helps in running functions as a different user. This command is the easiest way to change the administrative account in the current logged-in session.
-
userdel:- It is used to delete a user account and related files. This command basically modifies the system account files, deleting all the entries which refer to the username LOGIN.
-
groupadd:- The groupadd command creates a new group account using the values specified on the command line plus the default values from the system. The new group will be entered into the system files as needed.
-
gpasswd:- gpasswd command is used to administer the /etc/group and /etc/gshadow. As every group in Linux has administrators, members, and a password. It is an inherent security problem as more than one person is permitted to know the password.
-
groupdel:- The ‘groupdel’ command is a powerful tool in Linux that allows system administrators to delete existing groups. It is a part of the ‘passwd’ package and provides a straightforward way to manage group accounts on a Linux system.
Files Permission Commands
ls -l:- It known as a long format that displays detailed information (permission) about files and directories.
-
chmod 777:- So, in simpler words chmod 777 means granting all permissions to read, write and to execute any file by any user of the system.
-
umask:- It is used to set default permissions for files or directories the user creates.
Compression Commands
zip:- Zip is a file packaging and compression utility for Unix. All the files are stored inside a single file, i.e., .zip {.zip-filename} along with the .zip extension.
-
unzip:- The unzip command is used to extract files from a compressed ZIP archive.
File Transfer Commands
scp:- The SCP command or secure copy allows the secure transferring of files between the local host and the remote host or between two remote hosts. It uses the same authentication and security as it is used in the Secure Shell (SSH) protocol. SCP is known for its simplicity, security, and pre-installed availability.
Mastering Linux file Permission and user management is a key milestone on your DevOps Journey, bringing you closer to a secure and efficient computing environment.🚀