<<

Common administrative commands in Enterprise 5, 6, 7, and 8

System basics systems, volumes, and disks Jobs and services

TASK RHEL TASK RHEL TASK RHEL

/etc/sysconfig/rhn/ ext3 5 chkconfig --list View systemid 5 6 Default file /etc/.d/ 5 6 subscription system ext4 6 subscription-manager systemctl - service information 6 7 8 xfs identity 7 8 ls /etc// system/*.service 7 ssm create 7 rhnreg_ks 6 List all ls /usr/lib/systemd/ system/*.service Configure Create/ gdisk 7 8 services 1, 3 5 6 7 8 rhn_register modify disk subscription ssm_create 8 systemctl list-units partitions -at service 2 6 7 8 subscription-manager /etc/systemd/ / 8 5 6 7 8 usr/lib/systemd/ / hwbrowser 5 parted run/systemd/ -name sosreport ssm create 7 8 *.service” dmidecode 5 6 7 8 disk View system mkfs.filesystem_type service --status-all 5 6 partition List running profile lstopo (ext4, xfs) 5 6 7 8 6 7 8 systemctl -t service lscpu mkswap services 7 8 --state=active /proc/cpuinfo xfs_fsr 6 7 8 8 service name lshw 5 6 Defragment data to new file service name stop system disk space 5 6 7 8 View RHEL fsck (look for ‘non-con- Start/stop systemctl start name. version /etc/redhat-release 5 6 7 8 tiguous inodes’) service service 7 8 information systemctl stop name. ssm mount 7 8 service Mount storage mount chkconfig name on 1 Be aware of potential issues when using subscription-manager on 5 6 7 8 5 6 5: https://access.redhat.com/ /etc/fstab chkconfig name off solutions/129003. Enable/ Mount and /etc/fstab disable systemctl enable name. 2 Subscription-manager is used for 6, Satellite 5.6 with SAM swapon -a 5 6 7 8 service and newer, and Red Hat’s CDN. activate swap service 7 8 systemctl disable name. 3 RHN tools are deprecated on Red Hat Enterprise Linux 7. rhn_register service should be used for Satellite server 5.6 and newer only. For details, Configure /etc/fstab 5 6 7 8 see: What subscription management services are offered by RHSM?, static mounts service name status 5 6 Transition of Red Hat Network Classic Hosted to Red Hat View service systemctl status name. Subscription Management, and Satellite 5.6 unable to register status 7 8 View free disk service RHEL 7 client system due to rhn-setup package not included in 5 6 7 8 Minimal installation. space Check if chkconfig name --list 5 6 lvdisplay service is systemctl is-enabled lvs enabled name 7 8 View logical vgdisplay vgs 5 6 7 8 Software management volume info chkconfig --add pvdisplay Create new 5 6 TASK RHEL pvs service file systemctl daemon-reload or modify /etc/systemd/system/*. ssm create (if backend 7 8 groupinstall 5 6 Create configuration service is lvm) 8 Install physical yum group install software 7 8 volume pvcreate 5 6 7 8 runlevel 5 6 View run systemctl get-default yum install 5 6 7 8 ssm create (if backend level/target 7 8 Create volume 8 is lvm) -r 5 6 7 8 yum groupinfo 5 6 group vgcreate 5 6 7 8 /etc/inittab View software 5 6 yum group info 7 8 init run_level info ssm create (if backend Change run Create logical is lvm) 8 yum info 5 6 7 8 level/target systemctl isolate name. volume target 7 8 lvcreate 5 6 7 8 systemctl set-default Update yum update 5 6 7 8 software resize2fs /etc/syslog.conf Enlarge 5 6 5 volumes xfs_growfs /etc/rsyslog.conf 6 7 8 Upgrade 7 8 Configure yum upgrade 5 6 7 8 formatted ssm resize software with default logging /etc/rsyslog.d/*.conf /var/log/journal file system vgextend 7 8 5 6 7 8 systemd-journald. subscription-manager lvextend Configure service software repos 5 6 7 8 resize2fs repository /etc/yum.repos.d/*.repo Shrink lvreduce 5 6 journalctl 7 8 volumes vgreduce View logs /var/log 5 6 7 8 rpm -qf filename formatted Find package XFS cannot currently be yum provides 5 6 7 8 with default shrunk; copy desired pam_tty_audit kernel owning file 7 8 5 6 7 filename-glob file system data to a smaller file module system. tlog 8 rpm -q packagename 5 6 ssm check 8 View software Check/repair Configure add audit=1 to kernel yum list installed file system system audit cmdline version fsck 5 6 7 8 packagename 7 8 auditctl /etc/audit/auditd.conf rpm -q packagename 5 6 7 8 View NFS showmount -e /etc/audit/audit.rules share mount 5 6 7 8 authconfig View installed rpm -qa 5 6 7 8 /etc/pam.d/system-auth software yum list installed service nfs reload 5 6 View audit aureport 5 6 7 Install a yum module install Configure systemctl reload nfs. output /var/log/faillog 8 7 8 module module_name NFS share service /etc/exports 5 6 7 8 at 5 6 7 8 View info on a yum module info Schedule/ 8 batch module module_name Configure /etc/auto.master.d/*. batch tasks systemd-run on-demand autofs 8 8 auto-mounts /etc/auto.* --on-calendar View a yum module info module’s 8 module_name Find file by streams locate name 5 6 7 8 Change file 8 yum module remove permissions (future file module_name:stream Find file by find Change creation) characteristic 5 6 7 8 yum module reset module 8 module:stream Change file streams chattr 8 yum module install attributes cpio Create archive 5 6 7 8 module:new_stream zip Change xz setfacl List available yum module list access 8 modules 8 control list Basic configuration Kernel, boot, and hardware Security and identity

TASK RHEL TASK RHEL TASK RHEL

Graphical system-config-* 5 6 append 1 or s or init=/ /etc/selinux/config configuration bin/bash to kernel 5 6 Configure chcon gnome-control-center 7 8 Single user/ cmdline system restorecon tools semanage 5 6 7 8 rescue mode append 1 or s or security setsebool Text-based rd.break or init=/bin/ 7 8 system-config-selinux bash to kernel cmdline configuration system-config-*-tui 5 6 tools Report on Shut down 5 6 7 8 system sealert 5 6 7 8 system security Configure system-config-printer 5 6 7 printer gnome-control-center 8 Power off systemctl poweroff 7 8 authconfig authconfig-tui 5 6 7 system-config-date system LDAP, SSSD, 5 6 poweroff 5 6 7 8 authconfig-gtk Kerberos timedatectl 7 8 Configure systemctl halt 7 8 authselect 8 Halt system and date date 5 6 7 8 halt 5 6 7 8 Network users getent 5 6 7 8 gnome-control-center 8 Reboot systemctl reboot 7 8 /etc/ntp.conf 5 6 system reboot 5 6 7 8 ntpdate 5 6 7 /etc/inittab Synchronize timedatectl Configure 5 6 time and date /etc/chrony.conf 7 8 default run User management level/target systemctl set-default 7 8 date TASK RHEL 8 chronyc /boot/grub/grub.conf Configure 5 6 Graphical user system-config-users 5 6 7 system-config-keyboard 5 6 GRUB /etc/default/grub management Configure gnome-control-center 8 localectl 7 8 bootloader grub2-mkconfig 7 8 keyboard grub-set-default useradd 5 6 7 gnome-control-center 8 Create user hwbrowser 5 account gnome-control-center 8 /etc/ssh/ssh_config View hardware Configure /etc/ssh/sshd_config lshw (in EPEL) 6 7 5 6 7 8 configured SSH ~/.ssh/config Delete user userdel 5 6 7 ssh-keygen lshw 8 account gnome-control-center 8

Configure modprobe usermod kernel module 5 6 7 8 /etc/passwd View/change 5 6 7 vipw Configure user account Networking details id hardware udev 5 6 7 8 TASK RHEL device gnome-control-center 8

nmcli con mod Configure 7 8 View kernel sysctl -a Create user groupadd 5 6 7 name parameters cat /proc/cmdline 5 6 7 8 /etc/hosts group 5 6 7 8 gnome-control-center 8 resolution /etc/resolv.conf Load kernel groupdel 5 6 7 /etc/sysconfig/network 5 6 modprobe 5 6 7 8 Delete user module group Configure gnome-control-center 8 hostnamectl hostname /etc/hostname 7 8 Remove modprobe -r 5 6 7 8 groupmod nmtui 5 6 7 kernel module Change group /etc/group details ifconfig 5 6 View kernel rpm -q kernel gnome-control-center 8 5 6 7 8 nmcli dev show version -r View network teamdctl 7 8 Change user passwd 5 6 7 interface info bridge password gnome-control-center 8 ip addr 5 6 7 8 brctl usermod 5 6 7 Change user visudo nmcli con Resource management permissions [add|mod|edit] Configure 7 8 gnome-control-center 8 nmtui TASK RHEL network -connection-editor chage interface Change 5 6 7 /etc/sysconfig/ Trace system 5 6 7 8 5 6 7 8 password network-scripts/ifcfg-* calls policy gnome-control-center 8

ip 5 6 7 8 View routes Trace library w 5 6 7 ltrace 5 6 7 8 View user calls sessions system-config-network 5 6 gnome-control-center 8

nmcli Change nmtui Configure 7 8 process renice 5 6 7 8 routes nm-connection-editor priority ip route add /etc/sysconfig/ 5 6 7 8 Change route-iface process run taskset 5 6 7 8 location iptables and ip6tables 5 6 /etc/sysconfig/ip*tables Kill a process pkill 5 6 7 8 system-config-firewall 6 Configure killall firewall firewall-cmd 7 8 5 6 firewall-config ss nftables 8 tuna 6 7 8

pcp-dstat--socket 8 pcp atop 8 View ports/ View system ss usage top sockets lsof 5 6 7 8 netstat sar iostat 5 6 7 8 vmstat mpstat numastat

iostat 6 7 8 View disk pcp-dstat usage pmiostat 8

df 5 6 7 8

5/19

Copyright © 2019 Red Hat, Inc. Red Hat, Red Hat Enterprise Linux, the Red Hat logo, and JBoss are trademarks or registered trademarks of Red Hat, Inc. or its subsidiaries in the United States and other countries. Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.