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

RHEL7 My CheatSheet

This document lists common administrative commands for Red Hat Enterprise Linux 7. It covers commands for viewing system information, configuring networking, services, logging, scheduling tasks, software management, booting, hardware and security.

Uploaded by

Pascal Louis
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)
44 views1 page

RHEL7 My CheatSheet

This document lists common administrative commands for Red Hat Enterprise Linux 7. It covers commands for viewing system information, configuring networking, services, logging, scheduling tasks, software management, booting, hardware and security.

Uploaded by

Pascal Louis
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 7 Common administrative commands

SYSTEM BASICS
View subscription information subscription-manager identity

Configure subscription subscription-manager rhn_register

sosreport
View system profile dmidecode
lshw

View RHEL version information /etc/redhat-release

Graphical configuration tools gnome-control-center

nmcli
Configure network nmtui
nm-connection-editor

Configure system language localectl

timedatectl
Configure time and date date

timedatectl
Synchronize time and date /etc/chrony.conf

BASIC CONFIGURATION
Configure keyboard localectl

Text-based configuration tools system-config-*-tui

Configure printer system-config-printer

smbclient
Configure samba /etc/samba/smb.conf
smbpasswd
/etc/ssh/ssh_config
Configure SSH /etc/ssh/sshd_config
~/.ssh/config ssh-keygen

/etc/rsyslog.conf
/etc/rsyslog.d/*.conf
Configure logging /var/log/journal
systemd-journald.service
systemctl -at service
List all services ls /etc/systemd/system/*.service
ls /usr/lib/systemd/system/*.service
List running services systemctl -t service –state=active
systemctl start name.service
Start/stop service systemctl stop name.service

systemctl enable name.service


Enable/disable service systemctl disable name.service

View service status systemctl status name.service

Check if service is enabled systemctl is-enabled name

Create new service file or


systemctl daemon-reload
modify configuration
systemctl get-default
View run level/target who -r

systemctl isolate name.target


Change run level/target systemctl set-default

/var/log
View logs journalctl

add audit=1 to kernel cmdline


auditctl
/etc/audit/auditd.conf
Configure system audit /etc/audit/audit.rules
authconfig
/etc/pam.d/system-auth
pam_tty_audit kernel module

View audit output aureport /var/log/faillog

cron
Schedule tasks at
JOBS AND SERVICES

Configure batch tasks batch

Find file by name locate

Find file by characteristic find

tar
cpio
Create archive zip
gzip
bzip2

append rd.break or init=/bin/bash


Single user/rescue mode to kernel cmdline

Shut down system systemctl shutdown

Power off system systemctl poweroff

Halt system systemctl halt

Reboot system systemctl reboot

Configure default run level/target systemctl set-default

/etc/default/grub
KERNEL, BOOT, AND HARDWARE

Configure GRUB bootloader grub2-mkconfig


grub-set-default

View hardware configured lshw

Configure kernel module modprobe

Configure hardware device udev

sysctl -a
View kernel parameters cat /proc/cmdline

Load kernel module modprobe

Remove kernel module modprobe -r

rpm -q kernel
View kernel version uname -r

yum install
Install software yum group install

yum info
View software info yum group info

Update software yum update

Upgrade software yum upgrade


MANAGEMENT

Configure software repository /etc/yum.repos.d/*.repo


SOFTWARE

Find file in package rpm -qf filename

View software version rpm -q packagename

View installed software rpm -qa

/etc/selinux/config
chcon
Configure system restorecon
Security semanage
setsebool
system-config-selinux
AND IDENTITY

Report on system
sealert
Security
SECURITY

authconfig
LDAP, SSSD, Kerberos authconfig-tui
authconfig-gtk

Network users getent

Graphical user management system-config-users

Create user account useradd

Delete user account userdel

Change user account details usermod

usermod
View user account details /etc/passwd

Create user group groupadd

Delete user group groupdel

Change group details groupmod

Change user password passwd username

usermod
USER MANAGEMENT

Change user permissions /etc/sudoers

groupmod
Change group permissions /etc/sudoers

Change password policy chage

Encrypted password
/etc/shadow
Location
View/end user sessions w

Default file system xfs

copy data to new file system


Defragment disk space fsck (look for ‘non-contiguous inodes’)
xfs_fsr
fdisk
Create/modify disk gdisk
Partitions parted
ssm create
mkfs.filesystem_type (ext4, xfs)
Format disk partition mkswap
ssm create
mount
Mount storage /etc/fstab
ssm mount

pvcreate
Create physical volume ssm create (if backend is lvm)

vgcreate
Create volume group ssm create (if backend is lvm)

lvcreate
Create logical volume ssm create (if backend is lvm)

Enlarge volumes vgextend


lvextend
formatted with default xfs_growfs
file system ssm resize
Shrink volumes
xfs cannot currently be shrunk; copy
formatted with default desired data to a smaller file system.
file system
fsck
Check/repair file system ssm check

/etc/exports
Configure NFS share systemctl reload nfs.service

Mount and activate /etc/fstab


Swap swapon -a

Automatically mount /etc/fstab


at boot
View free disk space df
FILE SYSTEMS, VOLUMES, AND DISKS

lvdisplay
lvs
vgdisplay
View logical volume info vgs
pvdisplay
pvs

showmount -e
View NFS share mount

Automatically /etc/auto.master.d/*.autofs
mount after boot /etc/auto.*

chmod
chown
Change file permissions chgrp
umask
Change access setfacl
control list
View access
getfacl
control list

firewall-cmd
Configure firewall firewall-config

dhcpd
Configure DHCP client /etc/dhcp/dhcpd.conf
/etc/sysconfig/dhcpd
/etc/hosts
Configure name
/etc/resolv.conf
Resolution nmcli con mod
hostnamectl
Configure hostname /etc/hostname
nmtui
ip addr
nmcli dev show
View network interface info teamdctl
brctl
bridge
/etc/sysconfig/network-scripts/ifcfg-*
nmcli con [add|mod|edit]
Configure network interface nmtui
nm-connection-editor
NETWORKING

ss
View ports/sockets lsof

View routes ip route

/etc/sysconfig/network
Configure routes system-config-network

top
ps
sar
iostat
View system usage ss
vmstat
mpstat
numastat
tuna

df
View disk usage
RESOURCE MANAGEMENT

iostat

Trace system calls strace

Trace library calls ltrace

nice
Change process priority renice

Change process run location taskset

kill
Kill a process pkill
killall

You might also like