Chmod change the file/directory permission
The Chown to change the ownership of a file or directory and ownership away to someone else.
Cat /etc/inittab or who –r
LVM Id: 8e
Ping remote server IP. (to check alive or not)
Make sure remote server sshd service enabled
If everything is ok, login remote server ILO, open the remote console and check the status
Setfacl –m u:username:permission filename
Getfacl username (to check the user permissions)
Netstat –anultp service name or port number
Chkconfig –level 2 off
Hard Mount : After restarting the server keep on search nfs mount partition until found the device, if the device not found server not will not boot,.
Soft mount: if device not found it will skip
Rpm: need local rpm file and dependencies
Yum: need repository (collections of rpm) local or internet
du –sh <file/dir>
ps aux |grep “defunct” and ps aux |grep Z to Kill: In order to kill these processes, you need to find the parent process first.
pstree –paul and find parent process id, use kill -9
Remount –o rw,remount
/etc/hosts.deny à sshd: ALL except Node IP
Chage –l username
# pwunconv (It creates the users according /etc/passwd file and deletes the /etc/shadow file)
# passwd -x -1 <user login name> How to put never expiry to a user?
# passwd -x -1 <user login name>
# fuser -cu (to see who are login)
#fuser -ck <user login name>(to kill the specified user)
# chkconfig <service name> on
# nmap -p 22 <IP address of the remote host> (to see the ssh is running or not on remote system)
Nmap servername portname
Hardware error, Kernel error
Lsof |wc –l (list of open files)
If more than 65k, open /etc/sysctl.conf increase the file.mx value and execute below command
fsck <device or partition name>command we can check the integrity of the file system.
The before running the fsck command first unmount that partition and then run fsck command.
Disk is full.
Disk is failing or failed.
File system corrupted or crashed.
O/S is not recognizing the remote luns when scanning, …etc.,
The default run level command is /etc/inittab file in most Linux operating systems.
May be there is no access to outside.
May be outside is in a different network from the local.
May be permission is denied for that system to access outside.
If there is access, but router or modem or network switch or NIC may not be working to access the outside.
Permission check and disk space getting full
The ping command is used to determine connectivity between hosts on a network
$ ping google.com
Crontab –l –u rbtadmin
There are Three types of class
class A 1-126
class B 128-191
class c 192-221
# systemctl restart network
# useradd linux
# passwd linux
# su linux
# cat /etc/passwd
# groupadd my group
# cat /etc/my group
#useradd -d/root/abi abhi
The date command displays/sets the system date and time like this.
$ date –set=”8 JUN 2017 13:00:00″
It reflects the status of previous command
If 0 – Success
If Non-Zero – Not Success
It considers the script as a PHP script
It’s the average of the usage of each CPU
It can be found with 4 commands
ps ax –forest
This command is the task manager of linux. We could able to find load average, memory usage, swap usage, total number of processes, CPU, Memory usage of each processes in sorted format.
It is shortcut of a big command, we can do this using the command ‘ln’
Eg: ln -s /usr/local/redis/bin/redis-cli /usr/bin/redis-cli
We can directly use the command redis-cli
All process identification is stored in this folder
It will list all process id as folders /proc/12435
It will show the command used by the process
It will show the files used by the process
Memory dump etc
Use ‘grep’ command
Eg: cat /proc/meminfo | grep MemFree
Find it using ‘tty’ command or who command
Fix it by adding atleast the system binary path, so that basic command
semanage user -l
Edit /etc/selinux/config anf change the enforcement to disabled and reboot the server.
Yes, use LVM
LVM is a utility for dynamically extent or shrink a volume. ext3, ext4, it is not possible.
Once the above command is executed, the new volgroup will be available to use.
mount to a location like
mount /dev/mapper/VolGroup/pv /mnt
rpm -qi <package>
It gives the package in which the provided binary associated.
(firewall-cmd –zone external –permanent –add-forward-port port=25:proto=tcp:toaddr=10.10.1.80)
It will forward the inward traffic of SMTP to the IP mentioned.
kadmin, ktadd, authconfig, kinit
Open /etc/rsyslog.conf and add the following line.
systemctl restart rsyslog
It defines the file to be considered as index file. Eg ‘DirectoryIndex index.php index.html’ : In this it will find index.php first when the URL is accessed, if this file is not available, it will search for index.html as index page.
Passwd is used for setting the password for a System User.
Htpasswd is used for setting the password for Apache Web User.
For web files, httpd_sys_content_t is used
For NFS mount files, httpd_use_nfs
apachectl -t : Checks Syntax
apachectl start/stop/restart : For handling service
Use command : httpd -D DUMP_VHOSTS
Execute command : postconf -e inet_interfaces=all
Use : alternatives –config mta (mta is mail transfer agent)
Its is Pointer Record for reverse lookup : Inorder to get hostname if IP is queried.
dig @184.108.40.206 domainname
dig -x IP-Address
Use command : mysqldump -hHOST -uUSER -pPASSWORD DB_NAME > DB_NAME.sql
mysql -hHOST -uUSER -pPASSWORD DB_NAME < DB_NAME.sql (Create DB prior using ‘create database db_name’)
Use Init command : init 6 (6 option is for reboot in Linux Runlevels)
chmod g+s /usr/bin/wall