<<

RED HAT ENTERPRISE 5, 6, AND 7 SOFTWARE MANAGEMENT NETWORKING Common administrative commands TASK RHEL TASK RHEL yum install iptables and ip6tables 5 6 5 yum groupinstall /etc/sysconfig/ip*tables Install software iptables and ip6tables 1 Be aware of potential issues when using subscription-manager yum install 7 Configure firewall /etc/sysconfig/ip*tables 6 SYSTEM BASICS on Red Hat Enterprise Linux 5: https://access.redhat.com/ yum group install system-config-firewall solutions/129003. TASK RHEL yum info firewall-cmd 2 Subscription-manager is used for Satellite 6, Satellite 5.6 with 5 6 7 SAM and newer, and Red Hat’s CDN. yum groupinfo firewall-config /etc/sysconfig/rhn/systemid 5 3 RHN tools are deprecated on Red Hat Enterprise Linux 7. View software info /etc/hosts yum info 5 6 rhn_register should be used for Satellite server 5.6 and newer 7 /etc/resolv.conf /etc/sysconfig/rhn/systemid yum group info View subscription information 6 only. For details, see: Satellite 5.6 unable to register RHEL 7 Configure name subscription-manager identity client system due to rhn-setup package not included in Minimal resolution /etc/hosts installation (https://access.redhat.com/solutions/737373) Update software yum update 5 6 7 /etc/resolv.conf 7 subscription-manager identity 7 nmcli con mod rhn_register 5 Upgrade software yum upgrade 5 6 7 /etc/sysconfig/network 5 6 subscription-manager 1 Configure hostname hostnamectl rhn_register Configure software subscription-manager repos 5 6 7 /etc/hostname 7 rhnreg_ks 6 /etc/yum.repos.d/*.repo Configure subscription repository nmtui subscription-manager ip addr 2 rpm -qf filename subscription-manager file in package 5 6 7 5 6 3 7 yum provides filename-glob rhn_register brctl

sosreport View software version rpm -q packagename 5 6 7 View network ip addr 5 interface info dmidecode RESOURCE MANAGEMENT nmcli dev show hwbrowser View installed rpm -qa teamdctl 7 View system profile yum list installed 5 6 7 brctl sosreport TASK RHEL software bridge dmidecode 6 7 lstopo top /etc/sysconfig/network-scripts/ifcfg-* 5 6 lscpu ps sar Configure network /etc/sysconfig/network-scripts/ifcfg-* View RHEL version information /etc/redhat-release 5 6 7 iostat nmcli con [add|mod|edit] 5 USER MANAGEMENT interface 7 nmtui vmstat TASK RHEL nm-connection-editor mpstat ss numastat Graphical user BASIC CONFIGURATION system-config-users 5 6 7 lsof 5 6 top management View ports/sockets netstat ps TASK RHEL ss sar useradd 5 6 7 7 Create user account lsof system-config-* 5 6 iostat Graphical configuration tools netstat 6 Delete user account userdel 5 6 7 ip route add gnome-control-center 7 View system usage ss system-config-network 5 6 vmstat usermod /etc/sysconfig/route-iface system-config-network 5 6 mpstat View/change user /etc/passwd numastat 5 6 7 Configure routes ip route add nmcli vipw Configure network tuna account details nmcli nmtui 7 id nmtui 7 nm-connection-editor top nm-connection-editor ps Create user group groupadd 5 6 7 /etc/sysconfig/route-iface system-config-language 5 6 sar Configure system language ip route 5 6 7 localectl 7 iostat Delete user group groupdel 5 6 7 View routes ss 7 system-config-date vmstat 5 6 groupmod 5 6 7 date mpstat Change group details /etc/group Configure and date numastat timedatectl tuna 7 Change user SECURITY AND IDENTITY date passwd 5 6 7 df 5 password TASK RHEL ntpdate 5 6 View disk usage /etc/ntp.conf df 6 7 Change user usermod /etc/selinux/config iostat 5 6 7 Synchronize time and date timedatectl permissions visudo chcon Configure system restorecon /etc/chrony.conf 7 Trace system calls strace 5 6 7 5 6 7 semanage ntpdate Change group groupmod security 5 6 7 setsebool Trace library calls ltrace 5 6 7 visudo system-config-keyboard 5 6 permissions system-config-selinux Configure keyboard Change process nice localectl 7 5 6 7 Change password Report on system priority renice chage 5 6 7 sealert 5 6 7 Text-based configuration tools system-config-*-tui 5 6 7 policy security Change process taskset 5 6 7 Configure printer system-config-printer 5 6 7 run location View user sessions w 5 6 7 LDAP, SSSD, authconfig authconfig-tui 5 6 7 Kerberos /etc/ssh/ssh_config authconfig-gtk Configure SSH /etc/ssh/sshd_config 5 6 7 Kill a process pkill 5 6 7 ~/.ssh/config ssh-keygen killall Network users getent 5 6 7 JOBS AND SERVICES FILE SYSTEMS, VOLUMES, AND DISKS FILE SYSTEMS, VOLUMES, AND DISKS (CONT.)

TASK RHEL TASK RHEL TASK RHEL

/etc/syslog.conf 5 ext3 5 lvdisplay lvs /etc/rsyslog.conf 6 Default file system ext4 6 vgdisplay 5 6 7 View logical volume info vgs Configure logging xfs 7 /etc/rsyslog.conf pvdisplay /etc/rsyslog.d/*.conf 7 data to new file system pvs /var/log/journal 5 fsck (look for ‘non-contiguous inodes’) systemd-journald.service Configure on-demand /etc/auto.master.d/*.autofs 5 6 7 Defragment disk space copy data to new file system auto-mounts /etc/auto.* chkconfig --list 5 6 fsck (look for ‘non-contiguous inodes’) 6 7 ls /etc/init.d/ xfs_fsr chmod chown List all services systemctl - service Change file permissions 5 6 7 5 6 chgrp ls /etc/systemd/system/*.service 7 parted umask (future file creation) ls /usr/lib/systemd/system/*.service Create/modify disk fdisk Change file attributes chattr 5 6 7 service --status-all 5 6 partitions gdisk List running services 7 parted Change access control list setfacl 5 6 7 systemctl -t service --state=active 7 ssm create service name 5 6 mkfs.filesystem_type (ext4, xfs) 5 6 service name stop mkswap Start/stop service systemctl start name.service disk partition mkfs.filesystem_type (ext4, xfs) KERNEL, BOOT, AND HARDWARE 7 systemctl stop name.service mkswap 7 ssm create TASK RHEL chkconfig name on 5 6 append 1 or s or init=/bin/bash to kernel cmdline 5 6 chkconfig name off mount 5 6 /etc/fstab Single user/rescue mode Enable/disable service append rd.break or init=/bin/bash to kernel cmdline 7 systemctl enable name.service 7 Mount storage mount systemctl disable name.service /etc/fstab 7 5 6 service name status 5 6 ssm mount Shut down system shutdown 7 View service status systemctl shutdown systemctl status name.service 7 pvcreate 5 6 Create physical volume poweroff 5 6 chkconfig name --list 5 6 pvcreate 7 Check if service is enabled ssm create (if backend is lvm) Power off system poweroff 7 systemctl is-enabled name 7 systemctl poweroff vgcreate 5 6 chkconfig --add 5 6 Create new service file or Create volume group halt 5 6 vgcreate 7 modify configuration systemctl daemon-reload ssm create (if backend is lvm) Halt system 7 halt 7 /etc/systemd/system/*.service systemctl halt lvcreate 5 6 runlevel 5 6 Create logical volume reboot 5 6 who -r lvcreate 7 View run level/target ssm create (if backend is lvm) Reboot system reboot 7 systemctl get-default 7 systemctl reboot who -r vgextend lvextend 5 6 /etc/inittab 5 6 /etc/inittab 5 6 resize2fs Configure default run level/target init run_level Enlarge volumes formatted systemctl set-default 7 Change run level/target with default file system vgextend systemctl isolate name.target 7 lvextend 7 /boot/grub/grub.conf 5 6 systemctl set-default xfs_growfs ssm resize Configure GRUB bootloader /etc/default/grub /var/log 5 6 grub2-mkconfig 7 View logs resize2fs grub-set-default /var/log 7 lvreduce 5 6 journalctl Shrink volumes formatted vgreduce hwbrowser 5 with default file system View hardware configured add audit=1 to kernel cmdline XFS cannot currently be shrunk; copy desired 7 lshw (in EPEL) 6 7 auditctl data to a smaller file system. /etc/audit/auditd.conf Configure kernel module modprobe 5 6 7 Configure system audit /etc/audit/audit.rules 5 6 7 fsck 5 6 authconfig Configure hardware device udev 5 6 7 Check/repair file system fsck /etc/pam.d/system-auth 7 ssm check pam_tty_audit kernel module View kernel parameters sysctl -a 5 6 7 /etc/exports cat /proc/cmdline 5 6 View audit output aureport /var/log/faillog 5 6 7 service nfs reload Configure NFS share Load kernel module modprobe 5 6 7 /etc/exports cron 7 Schedule/batch tasks at 5 6 7 systemctl reload nfs.service Remove kernel module modprobe -r 5 6 7 batch /etc/fstab 5 6 7 rpm -q kernel Mount and activate swap swapon -a View kernel version 5 6 7 Find file by name locate 5 6 7 uname -r Configure static mounts /etc/fstab 5 6 7 Find file by characteristic find 5 6 7 View free disk space df 5 6 7 11/14 Create archive cpio 5 6 7 showmount -e Copyright © 2014 Red Hat, Inc. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, and JBoss are zip View NFS share 5 6 7 trademarks of Red Hat, Inc., registered in the U.S. and other countries. Linux® is the registered trademark mount of Linus Torvalds in the U.S. and other countries.