0% found this document useful (0 votes)
98 views1 page

Common Administrative Commands: Red Hat Enterprise Linux 5, 6, and 7

rhel

Uploaded by

ravadmins
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views1 page

Common Administrative Commands: Red Hat Enterprise Linux 5, 6, and 7

rhel

Uploaded by

ravadmins
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

RED HAT ENTERPRISE LINUX 5, 6, AND 7

KERNEL, BOOT, AND HARDWARE


Common administrative commands TASK RHEL

append 1 or s or init=/bin/bash to kernel cmdline 5 6


Single user/rescue mode
append rd.break or init=/bin/bash to kernel cmdline 7

SYSTEM BASICS JOBS AND SERVICES Shut down system shutdown 5 6

TASK RHEL TASK RHEL poweroff 5 6

/etc/sysconfig/rhn/systemid 5 /etc/syslog.conf 5 Power off system poweroff


7
systemctl poweroff
View subscription /etc/sysconfig/rhn/systemid /etc/rsyslog.conf 6
6
information subscription-manager identity
Configure logging halt 5 6
/etc/rsyslog.conf
subscription-manager identity 7 /etc/rsyslog.d/*.conf Halt system halt
7 7
/var/log/journal systemctl halt
rhn_register systemd-journald.service
5
subscription-manager 1 reboot 5 6
chkconfig --list
rhn_register ls /etc/init.d/
5 6 Reboot system reboot
7
Configure subscription rhnreg_ks 6
List all services systemctl reboot
subscription-manager systemctl -at service
ls /etc/systemd/system/*.service 7 Configure default run /etc/inittab 5 6
subscription-manager 2 7
ls /usr/lib/systemd/system/*.service
level/target
rhn_register 3 systemctl set-default 7
service --status-all 5 6
sosreport List running services /boot/grub/grub.conf 5 6
dmidecode 5 systemctl -t service --state=active 7
hwbrowser Configure GRUB bootloader /etc/default/grub
service name start grub2-mkconfig 7
View system profile 5 6
sosreport service name stop grub-set-default
dmidecode Start/stop service
6 7 systemctl start name.service hwbrowser 5
lstopo 7
lscpu systemctl stop name.service View hardware configured
lshw (in EPEL) 6 7

View RHEL version chkconfig name on


5 6 Configure kernel module modprobe 5 6 7
/etc/redhat-release 5 6 7 chkconfig name off
information Enable/disable service
systemctl enable name.service
7
Configure hardware device udev 5 6 7
systemctl disable name.service
1 Be aware of potential issues when using subscription-manager on Red Hat Enterprise Linux 5:
sysctl -a
https://access.redhat.com/solutions/129003.
service name status 5 6 View kernel parameters cat /proc/cmdline
5 6 7
2 Subscription-manager is used for Satellite 6, Satellite 5.6 with SAM and newer, and Red Hats CDN. View service status
3 RHN tools are deprecated on Red Hat Enterprise Linux 7. rhn_register should be used for Satellite server 5.6 and systemctl status name.service 7 Load kernel module modprobe 5 6 7
newer only. For details, see: Satellite 5.6 unable to register RHEL 7 client system due to rhn-setup package not
included in Minimal installation (https://access.redhat.com/solutions/737373) chkconfig name --list 5 6
Check if service is enabled Remove kernel module modprobe -r 5 6 7
systemctl is-enabled name 7
rpm -q kernel
View kernel version uname -r
5 6 7
chkconfig --add 5 6
Create new service file or
modify configuration systemctl daemon-reload
BASIC CONFIGURATION /etc/systemd/system/*.service
7
FILE SYSTEMS, VOLUMES, AND DISKS
TASK RHEL runlevel
5 6
who -r TASK RHEL
Graphical configuration system-config-* 5 6 View run level/target
systemctl get-default ext3 5
tools 7
gnome-control-center 7 who -r
Default file system ext4 6
system-config-network 5 6 /etc/inittab
5 6
init run_level xfs 7
Configure network nmcli Change run level/target
nmtui 7 systemctl isolate name.target copy data to new file system
7 5
nm-connection-editor systemctl set-default fsck (look for non-contiguous inodes)

Configure system system-config-language 5 6 /var/log 5 6 Defragment disk space copy data to new file system
View logs fsck (look for non-contiguous inodes) 6 7
language localectl 7 /var/log
7 xfs_fsr
journalctl
system-config-date fdisk
5 6 5 6
date add audit=1 to kernel cmdline parted
Configure time and date auditctl
timedatectl /etc/audit/auditd.conf
Create/modify disk
7 fdisk
date Configure system audit /etc/audit/audit.rules 5 6 7 partitions gdisk
7
authconfig parted
ntpdate /etc/pam.d/system-auth
5 6 ssm create
/etc/ntp.conf pam_tty_audit kernel module
Synchronize time mkfs.filesystem_type (ext4, xfs)
and date timedatectl
View audit output aureport /var/log/faillog 5 6 7 mkswap
5 6
/etc/chrony.conf 7
ntpdate Format disk partition mkfs.filesystem_type (ext4, xfs)
cron
mkswap 7
system-config-keyboard 5 6 Schedule/batch tasks at 5 6 7
ssm create
Configure keyboard batch
localectl 7
mount
Find file by name locate 5 6 7
/etc/fstab
5 6
Text-based
system-config-*-tui 5 6 7 Mount storage
configuration tools Find file by characteristic find 5 6 7 mount
/etc/fstab 7
Configure printer system-config-printer 5 6 7 tar ssm mount
Create archive cpio 5 6 7
/etc/ssh/ssh_config zip pvcreate 5 6
Configure SSH /etc/ssh/sshd_config 5 6 7 Create physical volume pvcreate
~/.ssh/config ssh-keygen 7
ssm create (if backend is lvm)
NETWORKING vgcreate 5 6

RESOURCE MANAGEMENT TASK RHEL Create volume group vgcreate


7
ssm create (if backend is lvm)
TASK RHEL iptables and ip6tables
5
/etc/sysconfig/ip*tables lvcreate 5 6
top
ps iptables and ip6tables Create logical volume lvcreate
Configure firewall /etc/sysconfig/ip*tables 6 7
sar ssm create (if backend is lvm)
iostat system-config-firewall
5 vgextend
netstat
firewall-cmd lvextend 5 6
vmstat 7
firewall-config resize2fs
mpstat
numastat
Enlarge volumes formatted
/etc/hosts
/etc/resolv.conf
5 6 with default file system vgextend
top lvextend
7
ps Configure name resolution /etc/hosts
xfs_growfs
sar ssm resize
/etc/resolv.conf 7
iostat nmcli con mod resize2fs
netstat
6 lvreduce 5 6
View system usage ss /etc/sysconfig/network 5 6 Shrink volumes formatted vgreduce
vmstat
mpstat Configure hostname hostnamectl with default file system
XFS cannot currently be shrunk; copy desired data
numastat /etc/hostname 7 7
to a smaller file system.
tuna nmtui
fsck 5 6
top ip addr
ps ifconfig 5 6 Check/repair file system fsck
sar brctl 7
ssm check
iostat
ss 7 View network interface info ip addr /etc/exports
vmstat nmcli dev show 5 6
service nfs reload
mpstat teamdctl 7 Configure NFS share
numastat brctl /etc/exports
7
tuna bridge systemctl reload nfs.service

df 5 /etc/sysconfig/network-scripts/ifcfg-* 5 6 /etc/fstab
Mount and activate swap swapon -a
5 6 7
View disk usage df /etc/sysconfig/network-scripts/ifcfg-*
6 7 Configure network interface nmcli con [add|mod|edit]
iostat 7 Configure static mounts /etc/fstab 5 6 7
nmtui
Trace system calls strace 5 6 7 nm-connection-editor
View free disk space df 5 6 7
ss
Trace library calls ltrace 5 6 7 lsof 5 6 lvdisplay
netstat lvs
nice View ports/sockets vgdisplay
Change process priority renice
5 6 7 View logical volume info vgs
5 6 7
ss
7 pvdisplay
lsof
Change process run taskset
pvs
5 6 7 ip route add
location
system-config-network showmount -e
5 6 View NFS share mount
5 6 7
kill /etc/sysconfig/route-iface
Kill a process pkill 5 6 7
killall Configure routes ip route add Configure on-demand /etc/auto.master.d/*.autofs
nmcli 5 6 7
auto-mounts /etc/auto.*
nmtui 7
nm-connection-editor chmod
USER MANAGEMENT /etc/sysconfig/route-iface
Change file permissions
chown
5 6 7
chgrp
View routes ip route 5 6 7 umask (future file creation)
TASK RHEL

Graphical user Change file attributes chattr 5 6 7


system-config-users 5 6 7
management SOFTWARE MANAGEMENT Change access control list setfacl 5 6 7

Create user account useradd 5 6 7 TASK RHEL

Delete user account userdel 5 6 7 yum install


yum groupinstall
5 6 SECURITY AND IDENTITY
usermod Install software
View/change user yum install TASK RHEL
/etc/passwd 7
5 6 7 yum group install
account details vipw
/etc/selinux/config
id
yum info chcon
5 6 restorecon
yum groupinfo Configure system security
Create user group groupadd 5 6 7
View software info semanage
5 6 7
yum info setsebool
7
Delete user group groupdel 5 6 7 yum group info system-config-selinux

Change group details


groupmod
5 6 7 Update software yum update 5 6 7 Report on system security sealert 5 6 7
/etc/group
Upgrade software yum upgrade 5 6 7 authconfig
Change user password passwd 5 6 7 LDAP, SSSD, Kerberos authconfig-tui 5 6 7
Configure software authconfig-gtk
usermod subscription-manager repos
5 6 7
Change user permissions 5 6 7 repository /etc/yum.repos.d/*.repo
visudo Network users getent 5 6 7

Change group groupmod


5 6 7 Find file in package rpm -qf filename 5 6 7
yum provides filename-glob
permissions visudo

View software version rpm -q packagename 5 6 7 04/17


Change password policy chage 5 6 7
rpm -qa Copyright 2017 Red Hat, Inc. Red Hat, Red Hat Enterprise Linux, the Shadowman logo,
View user sessions w 5 6 7 View installed software yum list installed
5 6 7 and JBoss are trademarks of Red Hat, Inc., registered in the U.S. and other countries.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy