Common Administrative Commands in Red Hat Enterprise Linux 5, 6, 7, and 8
Total Page:16
File Type:pdf, Size:1020Kb
Common administrative commands in Red Hat Enterprise Linux 5, 6, 7, and 8 System basics Kernel, boot, and hardware Basic configuration File systems, volumes, and disks TASK RHEL TASK RHEL TASK RHEL TASK RHEL /etc/sysconfig/rhn/systemid 5 6 append 1 or s or init=/bin/bash Graphical system-config-* 5 6 ext3 5 View 5 6 subscription to kernel cmdline configuration Default file information subscription-manager identity 6 7 8 Single user/ tools gnome-control-center 7 8 ext4 6 system rescue mode append 1 or s or rd.break or rhnreg_ks 6 init=/bin/bash to kernel 7 8 Text-based xfs 7 8 cmdline configuration system-config-*-tui 5 6 Configure 1, 3 tools rhn_register 5 6 7 8 ssm create 7 subscription Shut down shutdown 5 6 7 8 2 system system-config-printer 5 6 7 subscription-manager 6 7 8 Configure gdisk 7 8 printer Create/modify systemctl poweroff 7 8 gnome-control-center 8 hwbrowser 5 Power off disk partitions ssm_create 8 system system-config-date 5 6 sosreport poweroff 5 6 7 8 fdisk 5 6 7 8 5 6 7 8 dmidecode parted timedatectl 7 8 View system systemctl halt 7 8 Configure time Halt system profile lstopo and date ssm create 7 8 6 7 8 date 5 6 7 8 lscpu halt 5 6 7 8 Format disk partition mkfs.filesystem_type (ext4, xfs) gnome-control-center 8 5 6 7 8 cat/proc/cpuinfo systemctl reboot 7 8 8 mkswap lshw Reboot system /etc/ntp.conf 5 6 reboot 5 6 7 8 xfs_fsr 6 7 8 View RHEL ntpdate 5 6 7 Defragment version /etc/redhat-release 5 6 7 8 Configure /etc/inittab 5 6 disk space copy data to new file system information default run Synchronize timedatectl fsck (look for ‘non-contiguous 5 6 7 8 level/target time and date 7 8 systemctl set-default 7 8 /etc/chrony.conf inodes’) 1 Be aware of potential issues when using subscription-manager on Red Hat Enterprise Linux 5: https://access.redhat.com/solutions/129003. /boot/grub/grub.conf 5 6 date ssm mount 7 8 Configure 8 2 Subscription-manager is used for Satellite 6, Satellite 5.6 with SAM and newer, and Red chronyc Mount storage Hat’s CDN. GRUB /etc/default/grub mount 5 6 7 8 3 RHN tools are deprecated on Red Hat Enterprise Linux 7. rhn_register should be used for bootloader grub2-mkconfig 7 8 system-config-keyboard 5 6 /etc/fstab Satellite server 5.6 and newer only. For details, see: What subscription management services grub-set-default are offered by RHSM?, Transition of Red Hat Network Classic Hosted to Red Hat Configure Subscription Management, and Satellite 5.6 unable to register RHEL 7 client system due to localectl 7 8 Mount and /etc/fstab keyboard 5 6 7 8 rhn-setup package not included in Minimal installation. hwbrowser 5 activate swap swapon -a gnome-control-center 8 View hardware lshw (in EPEL) 6 7 Configure configured /etc/fstab 5 6 7 8 /etc/ssh/ssh_config static mounts 8 /etc/ssh/sshd_config lshw Configure SSH 5 6 7 8 ~/.ssh/config View free disk df 5 6 7 8 Configure ssh-keygen space Software management modprobe 5 6 7 8 kernel module TASK RHEL lvdisplay Configure lvs yum groupinstall 5 6 View logical vgdisplay hardware udev 5 6 7 8 5 6 7 8 volume info vgs Install device 7 8 pvdisplay software yum group install View kernel sysctl -a Jobs and services pvs 5 6 7 8 yum install 5 6 7 8 parameters cat /proc/cmdline TASK RHEL Create ssm create (if backend is lvm) 8 yum groupinfo 5 6 Load kernel physical modprobe 5 6 7 8 chkconfig --list module 5 6 volume pvcreate 5 6 7 8 View software ls /etc/init.d/ 7 8 info yum group info Remove kernel systemctl -at service ssm create (if backend is lvm) 8 modprobe -r 5 6 7 8 Create volume yum info 5 6 7 8 module ls /etc/systemd/system/*. group service 7 vgcreate 5 6 7 8 Update View kernel rpm -q kernel ls /usr/lib/systemd/system/*. yum update 5 6 7 8 5 6 7 8 List all services software version service ssm create (if backend is lvm) 8 uname -r Create logical volume Upgrade systemctl list-units -at lvcreate 5 6 7 8 yum upgrade 5 6 7 8 software service find /etc/systemd/ /usr/lib/ 8 resize2fs 5 6 Configure systemd/ /run/systemd/ -name Enlarge subscription-manager repos *.service” software 5 6 7 8 volumes xfs_growfs /etc/yum.repos.d/*.repo 7 8 repository User management formatted with ssm resize service --status-all 5 6 default file TASK RHEL List running Find package rpm -qf filename system vgextend 5 6 7 8 services systemctl -t service 5 6 7 8 owning file yum provides filename-glob 7 8 lvextend Graphical user system-config-users 5 6 7 --state=active management rpm -q packagename 5 6 gnome-control-center 8 service name start resize2fs View software 5 6 lvreduce 5 6 service name stop Shrink volumes version yum list installed packagename useradd 5 6 7 Start/stop vgreduce 7 8 Create user formatted with rpm -q packagename service account systemctl start name.service default file gnome-control-center 8 7 8 systemctl stop name.service system XFS cannot currently be shrunk; View installed rpm -qa copy desired data to a 7 8 5 6 7 8 userdel 5 6 7 software yum list installed Delete user chkconfig name on smaller file system. 5 6 account name gnome-control-center 8 Enable/disable chkconfig off Install a ssm check 8 yum module install module_name 8 service Check/repair module usermod systemctl enable name.service 7 8 file system View/change /etc/passwd systemctl disable name.service fsck 5 6 7 8 View info on a vipw 5 6 7 yum module info module_name 8 user account module id service name status 5 6 View NFS showmount -e details View service 5 6 7 8 share mount gnome-control-center status View a 8 systemctl status name.service 7 8 module’s yum module info module_name 8 service nfs reload 5 6 groupadd 5 6 7 streams Create user Check if chkconfig name --list 5 6 Configure NFS group service is 7 8 gnome-control-center 8 share systemctl reload nfs.service yum module remove enabled systemctl is-enabled name 7 8 Change module_name:stream Delete user groupdel 5 6 7 /etc/exports 5 6 7 8 module yum module reset module:stream 8 Create new chkconfig --add 5 6 streams yum module install group gnome-control-center 8 service file Configure module:new_stream or modify systemctl daemon-reload /etc/auto.master.d/*.autofs 7 8 on-demand 8 groupmod configuration /etc/systemd/system/*.service /etc/auto.* 5 6 7 auto-mounts List available Change group /etc/group yum module list 8 modules details runlevel 5 6 chmod gnome-control-center 8 View run level/ Change file chown systemctl get-default 7 8 8 passwd 5 6 7 target permissions chgrp Change user umask (future file creation) password 5 6 7 8 gnome-control-center 8 who -r Change file /etc/inittab chattr 8 usermod 5 6 attributes Networking 5 6 7 run_level Change user visudo Change run init TASK RHEL permissions level/target Change access gnome-control-center 8 systemctl isolate name.target setfacl 8 7 8 control list 7 8 systemctl set-default Configure nmcli con mod Change chage 5 6 7 name /etc/hosts password /etc/syslog.conf 5 resolution 5 6 7 8 /etc/resolv.conf policy gnome-control-center 8 6 7 8 Configure /etc/rsyslog.conf w 5 6 7 /etc/sysconfig/network 5 6 View user logging Configure sessions /etc/rsyslog.d/*.conf gnome-control-center 8 7 8 Resource management hostname hostnamectl /var/log/journal /etc/hostname 7 8 systemd-journald.service TASK RHEL nmtui journalctl 7 8 Trace system strace ifconfig 5 6 View logs calls 5 6 7 8 /var/log 5 6 7 8 nmcli dev show Trace library ltrace View network teamdctl 7 8 Security and identity pam_tty_audit kernel module 5 6 7 calls 5 6 7 8 interface info bridge TASK RHEL tlog 8 Change ip addr nice 5 6 7 8 /etc/selinux/config process 5 6 7 8 brctl Configure renice chcon add audit=1 to kernel cmdline priority Configure system audit restorecon auditctl nmcli con [add|mod|edit] system 5 6 7 8 /etc/audit/auditd.conf semanage 5 6 7 8 Change nmtui 7 8 security /etc/audit/audit.rules Configure setsebool process run taskset 5 6 7 8 network nm-connection-editor system-config-selinux authconfig location interface /etc/pam.d/system-auth /etc/sysconfig/network-scripts/ 5 6 7 8 Report on kill ifcfg-* View audit aureport system sealert 5 6 7 8 5 6 7 Kill a process pkill 5 6 7 8 security output /var/log/faillog killall View routes ip route 5 6 7 8 cron authconfig netstat 5 6 5 6 at 5 6 7 8 system-config-network authconfig-tui 5 6 7 Schedule/ LDAP, SSSD, batch authconfig-gtk batch tasks ss Kerberos nmcli tuna 6 7 8 Configure 7 8 systemd-run --on-calendar 8 nmtui authselect 8 routes nm-connection-editor pcp atop 8 Find file by View system Network users getent 5 6 7 8 locate 5 6 7 8 ip route add name usage 5 6 7 8 top /etc/sysconfig/route-iface ps Find file by find 5 6 7 8 sar iptables and ip6tables characteristic 5 6 iostat 5 6 7 8 /etc/sysconfig/ip*tables vmstat tar mpstat system-config-firewall 6 cpio numastat Configure Create archive 5 6 7 8 firewall zip firewall-cmd xz iostat 6 7 8 7 8 firewall-config pcp-dstat View disk usage 8 nftables 8 pmiostat pcp-dstat--socket 8 df 5 6 7 8 View ports/ sockets ss lsof 5 6 7 8 netstat 5/19 Copyright © 2019 Red Hat, Inc.