New Installation command
- yum to dnf
# old
yum install -y git
# new
dnf install -y git
# old
yum install -y git
# new
dnf install -y git
Hardware Information
OS info
cat /etc/redhat-release
cat /etc/issue
OS info
cat /etc/redhat-release
cat /etc/issue
Configuration
LoginProfile
Change directory color on ssh
- cp /etc/DIR_COLORS ~/.dircolors
- vi ~/.dircolors
DIR 01;36 # directory
LINK 36;01 # symbolic link
Change directory color on ssh
- cp /etc/DIR_COLORS ~/.dircolors
- vi ~/.dircolors
DIR 01;36 # directory
LINK 36;01 # symbolic link
Change hostname
hostnamectl set-hostname <HOSTNAME>
hostnamectl set-hostname <HOSTNAME>
SSHD
firewalld
- Centos7
# Check enable firewall daemon
systemctl is-enabled firewalld
# Show status firewall daemon
systemctl status firewalld
# Stop firewall daemon
systemctl stop firewalld
# Start firewall daemon
systemctl start firewalld
# Disable firewall daemon
systemctl disable firewalld
# Enable firewall daemon
systemctl enable firewalld
# Check enable firewall daemon
systemctl is-enabled firewalld
# Show status firewall daemon
systemctl status firewalld
# Stop firewall daemon
systemctl stop firewalld
# Start firewall daemon
systemctl start firewalld
# Disable firewall daemon
systemctl disable firewalld
# Enable firewall daemon
systemctl enable firewalld
Network
Trouble shooting
- See easy Network status
iftop
- Cannot connect internet
ping <gateway IP>
- if not returned, check
vi /etc/sysconfig/network-scripts/ifcfg-eth0
cat /etc/resolv.conf
- check DNS configuration. If is not set, put
nameserver 8.8.8.8
(Google DNS) - if change resolve.conf, execute
systemctl restart systemd-hostnamed
- ssh start fail
Job for sshd.service failed because a configured resource limit was exceeded. See "systemctl status sshd.service" \"journalctl -xe" for details.
- disable selinux
sudo setenforce 0
vi /etc/selinux/config
- /etc/selinux/config
SELINUX=disabled
iftop
ping <gateway IP>
- if not returned, check
vi /etc/sysconfig/network-scripts/ifcfg-eth0
- if not returned, check
cat /etc/resolv.conf
- check DNS configuration. If is not set, put
nameserver 8.8.8.8
(Google DNS) - if change resolve.conf, execute
systemctl restart systemd-hostnamed
- check DNS configuration. If is not set, put
Job for sshd.service failed because a configured resource limit was exceeded. See "systemctl status sshd.service" \"journalctl -xe" for details.
- disable selinux
sudo setenforce 0
vi /etc/selinux/config
- /etc/selinux/config
SELINUX=disabled
Permission
- If you have not permission of crontab edit
vi /etc/security/access.conf
+ : <loginname> : cron crond :0 tty1 tty2 tty3 tty4 tty5 tty6
vi /etc/security/access.conf
+ : <loginname> : cron crond :0 tty1 tty2 tty3 tty4 tty5 tty6
whereis
# all list
whereis -l
# target application
whereis mysql
# all list
whereis -l
# target application
whereis mysql
apache(httpd)
memory cache clear
echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches
echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches
warning : This command is very dangerous that is memory clear physically.
Register to service custom process
Disk
fdisk
fdisk /dev/sdc
- d delete a partition
- g create a new empty GPT partition table
- G create an IRIX (SGI) partition table
- l list known partition types
- m print this menu
- n add a new partition
- o create a new empty DOS partition table
- p print the partition table
- q quit without saving changes
- s create a new empty Sun disklabel
- t change a partition's system id
- v verify the partition table
- w write table to disk and exit
- x extra functionality (experts only)
fdisk /dev/sdc
format
format -t ext4 /dev/sdd1
format -t ext4 /dev/sdd1
mount
mount -t auto /dev/sdd1 /mnt/sdd1
mount -t auto /dev/sdd1 /mnt/sdd1
Journal
- journalctl コマンドの使い方
- ジャーナル保存領域の場所を指定する方法(-D <ジャーナル保存領域の場所>)
configuration
- does not use tcp_tw_recycle : https://qiita.com/tmshn/items/b49f1b51bfc472968b30
- centos7 ip change(add) on cli : https://i-think-it.net/centos7-ip-setting/
- CentOS6からの複数IP(secondary)設定方法
Tools
ASCII Code changer : http://web-apps.nbookmark.com/ascii-converter/
cp /etc/DIR_COLORS ~/.dircolors
DIR 01;36 # directory
LINK 36;01 # symbolic link
ASCII Code changer : http://web-apps.nbookmark.com/ascii-converter/
cp /etc/DIR_COLORS ~/.dircolors
DIR 01;36 # directory
LINK 36;01 # symbolic link
コメント
コメントを投稿