From c8e62421dfa4d18207cb0eb741d0ee6b07710275 Mon Sep 17 00:00:00 2001 From: Jacob Kritikos Date: Wed, 22 Mar 2023 18:04:09 -0400 Subject: [PATCH] linux user updates --- .../Linux-Commands-checkpoint.ipynb | 36 +++++++++++++++++-- Linux-Commands/Linux-Commands.ipynb | 23 +++++++++++- 2 files changed, 56 insertions(+), 3 deletions(-) diff --git a/Linux-Commands/.ipynb_checkpoints/Linux-Commands-checkpoint.ipynb b/Linux-Commands/.ipynb_checkpoints/Linux-Commands-checkpoint.ipynb index 61fe0f2..1d3925f 100644 --- a/Linux-Commands/.ipynb_checkpoints/Linux-Commands-checkpoint.ipynb +++ b/Linux-Commands/.ipynb_checkpoints/Linux-Commands-checkpoint.ipynb @@ -39,7 +39,27 @@ " |```sudo getent group sudo```| list of accounts that belong to the sudo Permissions| \n", " |```sudo passwd ```| Change userpassword | \n", " |```su - [user_name]``` OR ```sudo -i [user_name]```| change user | \n", - " \n", + " |` sudo useradd [USERNAME]`| add a new user with [USERNAME] | \n", + " |` sudo useradd -m [USERNAME]`| add a new User with [USERNAME] AND a home directory| \n", + " |` sudo useradd -r [USERNAME]`| add a new SYSTEM User with [USERNAME] (this type of user has ID under 1000 ** | \n", + " |`cat /etc/passwd`|list of all users (actual users) such as admin and SYSTEM Users *** | \n", + " |`users`| list of all users currently logged in according to FILE. | \n", + " |`ls -l /home`| print currently logged in users' home directories | \n", + " |`sudo userdel [USERNAME]`| deletes the user [USERNAME] | \n", + " |`sudo userdel -f [USERNAME]`| deletes the user [USERNAME] AND their home directory | \n", + " |` `| | \n", + " |` `| | \n", + " \n", + "\n", + "** System Users: are going to run in the background, schedule tasks processes etc.\n", + "\n", + "*** 1st column username, 2nd column refers to the hashed password which is in the `/etc/shadow` file (hashed password is not the actual password it the hashed version), 3rd column Uid (User ID) if under 1000 it's system user, else actual user. 4th column Gid (Group ID), 5th column, GECOS field (user information field, such as first last name and it's optional), 6th column refers to home directory of that user, 7th column shell that designated that user (what shell is activated when that user is logged in for actual users, for system users usually shell is `usr/sbin/nologin` where usually system users are not associated to human being and do not need to login)\n", + "\n", + "**References**: \n", + "- [Linux Crash Course - Managing Users](https://www.youtube.com/watch?v=19WOD84JFxA)\n", + "- [Text](https:///.com)\n", + "\n", + "\n", "### File & Folder Management\n", "\n", " | Command | Description|\n", @@ -125,7 +145,18 @@ " |```awk '{print $N}' [file_name]```| print the Nth column of a file_name| \n", " |```grep [search_keyword] [file_name]```| search and prints the lines of a search_keyword in a file_name| \n", " |```sort [file_name]```| sorts a file_name alphabetically| \n", - " |```uniq ```| |\n" + " |```uniq [file_name]```| removes all the duplicate lines from a file_name|\n", + " |```wc [file_name]```| counts the words of a file_name|\n", + " \n", + "### Compare Files\n", + "\n", + " | Command | Description|\n", + " |---|---|\n", + " |```diff [file_name_1] [file_name_2]```|compare two files Line by line | \n", + " |```сmр [file_name_1] [file_name_2]```| compare two files Byte by byte | \n", + " \n", + "• diff (Line by line)\n", + "• стр (Byte by byte)\n" ] }, { @@ -148,6 +179,7 @@ "`su` can also function as `sudo` and run a single command as the root:\n", "`su -c [command]`\n", "\n", + "** `sudo` used to run system command with root privileges, which is required for any command that's going to make changes to the system.\n", "\n", "\n", "### References\n", diff --git a/Linux-Commands/Linux-Commands.ipynb b/Linux-Commands/Linux-Commands.ipynb index 0e67c44..1d3925f 100644 --- a/Linux-Commands/Linux-Commands.ipynb +++ b/Linux-Commands/Linux-Commands.ipynb @@ -39,7 +39,27 @@ " |```sudo getent group sudo```| list of accounts that belong to the sudo Permissions| \n", " |```sudo passwd ```| Change userpassword | \n", " |```su - [user_name]``` OR ```sudo -i [user_name]```| change user | \n", - " \n", + " |` sudo useradd [USERNAME]`| add a new user with [USERNAME] | \n", + " |` sudo useradd -m [USERNAME]`| add a new User with [USERNAME] AND a home directory| \n", + " |` sudo useradd -r [USERNAME]`| add a new SYSTEM User with [USERNAME] (this type of user has ID under 1000 ** | \n", + " |`cat /etc/passwd`|list of all users (actual users) such as admin and SYSTEM Users *** | \n", + " |`users`| list of all users currently logged in according to FILE. | \n", + " |`ls -l /home`| print currently logged in users' home directories | \n", + " |`sudo userdel [USERNAME]`| deletes the user [USERNAME] | \n", + " |`sudo userdel -f [USERNAME]`| deletes the user [USERNAME] AND their home directory | \n", + " |` `| | \n", + " |` `| | \n", + " \n", + "\n", + "** System Users: are going to run in the background, schedule tasks processes etc.\n", + "\n", + "*** 1st column username, 2nd column refers to the hashed password which is in the `/etc/shadow` file (hashed password is not the actual password it the hashed version), 3rd column Uid (User ID) if under 1000 it's system user, else actual user. 4th column Gid (Group ID), 5th column, GECOS field (user information field, such as first last name and it's optional), 6th column refers to home directory of that user, 7th column shell that designated that user (what shell is activated when that user is logged in for actual users, for system users usually shell is `usr/sbin/nologin` where usually system users are not associated to human being and do not need to login)\n", + "\n", + "**References**: \n", + "- [Linux Crash Course - Managing Users](https://www.youtube.com/watch?v=19WOD84JFxA)\n", + "- [Text](https:///.com)\n", + "\n", + "\n", "### File & Folder Management\n", "\n", " | Command | Description|\n", @@ -159,6 +179,7 @@ "`su` can also function as `sudo` and run a single command as the root:\n", "`su -c [command]`\n", "\n", + "** `sudo` used to run system command with root privileges, which is required for any command that's going to make changes to the system.\n", "\n", "\n", "### References\n",