Redhat Admin 1
Redhat Admin 1
1983 - Richard Stallman Retired from Bell Labs and Started his own Project GNU (Open Source)
1995 - Windows Came with GUI Xorg made Xprotocol (Linux GUI)
Redhat = Linus Kernel + Richard's GNU +Xprotocol + Apps Made RHEL and Fedora
Debian Made the Same thing and Came up with Debian and Ubuntu
CentOS
Root User ID = 0
/home Contains a Directory for each User Ex: /home/mohamed/ Desktop, Downloads........
/bin Contains the binary files of the Commands Ex: the binary files of the ls, cd, mv commands
/sbin Contains the binary files of the System Commands Ex: the binary files of the useradd, userdel Commands
ls -R Recursive
ls -d directory info
su Switch User used to change the current logged in user Ex: su - root
tail display the last 10 lines of a text file Ex: tail file1.txt
wc Word Count Display the Number of lines, words and characters of a file Ex: wc file1
cat
more
whatis
-G overwrite
usermod Ex: usermod -G sales mohamed
-a append
-M Maximum Days
-m Minimum Days
chage
-I Inactivity
-W Warning days
ssh -i /home/yourUserName/.ssh/id_rsa RemoteUser@IP Login to Remote Server with your Private Key (without Password)
Remote Login
scp source destination:file from our Machine to remote server
SCP
scp source:file destination from remote server to our machine
Sudoers File gives user administrator privileges (use sudo command) Ex: nano /etc/sudoers
Ex: visudo
every file has an owner, group and other each one has his own permission
Owner " u " , Group " g " , Other " o " , All " a "
rwx = 4+2+1 = 7
Ex: if we want a file permission to be rwx rw- r--
Numeric Read = 4 , Write = 2 , Execute = 1 rw = 4+2+0 = 6
we will use the following comand: chmod 764 file2
r = 4+0+0 = 4
chgrp used to change the group of a file Ex: chgrp sales file1
Insert Mode Press " ESC " to get back to Command mode
Exit in Command mode use " :w " to write " :wq " to write and quit " :q! " to exit without saving
Vim
' / ' used to search
'A' used to append Jump to the end of a line and enter insert mode
yum install nano Checks the Repository and start installing nano Repositories Could be Found at /etc/yum.repos.d
Managed by firewall-cmd
firewall-cmd --add-service=http we can add --permanent so we don’t lose the configuration after reloading firewall
grep used to extract rows matching a criteria grep -A2 "khaled" /etc/passwd
the fastest way to search for a file in linux but it’s using a pre-built database of
locate paths to files on the system Ex: locate file1
DataBase must be updated by admin using "updatedb" Command
c = Create an archive
t = list an archive
x = extract files from an archive
tar is an archiving tool in linux tar cvf ArchiveName Files... v = verbose
f = file name
z = use gzip compression
Archiving j = use bzip2 compression
Can be Found at
Global /etc/bashrc
/etc/profile
Startup Files
~/.bashrc
User-Specific
~/.bash_profile