:# Commands

shutdown -H poweroff shutdown -P shutdown -r

lsshut /sys/firmware/shutdown_actions/on_trigger, where trigger can be halt, poff, reboot, restart, or panic.

# cat /sys/firmware/shutdown_actions/on_poff
stop
# echo ipl > /sys/firmware/shutdown_actions/on_restart

ps ax ps aux top free free -m lsblk blkid findmnt findmnt -l df df -h du du -h lspci lscpu

rsyslogd /etc/rsyslog.conf /var/log/

journalctl journalctl in leve view mode: journalctl -f

perf perf --version

[ibmsys1@kvm1awb ~]$ perf --version
perf version 3.10.0-229.7.2.el7_1.kvmibm1_1_1.23.s390x.kdump

yum list all yum info package_name yumdb info yum yum install package_name yum remove ...

# yum-config-manager

timedatectl timedatectl set-time 23:26:00 timedatectl set-time ’2015-06-07 23:26:00’ timedatectl set-ntp yes date date --utc date --set 2015-06-07 23:26:00

usermod -G wheel username /etc/pam.d/su sudo command use visudo to edit /etc/sudoers useradd [options] username passwd username useradd -m -c "Solution Test user" soltest passwd soltest Changing password for user soltest. New password: Retype new password: passwd: all authentication tokens updated successfully. chage -d 0 soltest usermod -a -G wheel soltest usermod [options] login userdel [-r] login groupadd [options] group_name groupmod [options] group_name groupdel group_name

mkfs -t ext3 -U 7cd65de3-e0be-41d9-b66d-96d749c02da7 /dev/sda8 tune2fs -U 7cd65de3-e0be-41d9-b66d-96d749c02da7 /dev/sda8

fsck

mkfs.ext4 /dev/device mkfs.ext4 -E stride=16,stripe-width=64 /dev/device mount /dev/device /mount/point mount -o acl,user_xattr /dev/device /mount/point mount -o data_err=abort /dev/device /mount/point tune2fs resize2fs /mount/device size resize2fs /dev/device size

e2fsck e2label quota fsfreeze debugfs e2image

mkfs.xfs /dev/device command Note: After an XFS file system is created, its size cannot be reduced. However, it can still be enlarged using the xfs_growfs command mkfs.xfs -d su=64k,sw=4 /dev/device mount /dev/device /mount/point The default mount option is inode64.

xfs_quota -x -c 'report -h' /home xfs_quota -x -c ’limit isoft=500 ihard=700 john’ /home/ xfs_quota -x -c ’limit -g bsoft=1000m bhard=1200m accounting’ /target/path xfs_quota -x -c ’project -s projectname’ project_path xfs_quota -x -c ’limit -p bsoft=1000m bhard=1200m projectname’

xfs_growfs /mount/point -D size xfs_repair /dev/device

xfs_fsr xfs_bmap xfs_info xfs_admin xfs_copy xfs_metadump xfs_mdrestore xfs_db

parted

As root, edit the /etc/fstab file to include the new partition using the partition's UUID. Use the command blkid -o list for a complete list of the partition's UUID, or blkid device for individual device details.

man fsdisk man fstab

lsmod | grep qeth Note: The qeth_13 module is loaded for OSA devices that are set with layer2=0. If the output of the lsmod command shows that the qeth modules are not loaded, issue the modprobe qeth command to load them.

cio_ignore -r read_device_bus_id,write_device_bus_id,data_device_bus_id cio_ignore -r 0.0.f500,0.0.f501,0.0.f502 znetconf -u znetconf -a f500 -o portname=myname -o buffer_count=128 echo 0.0.f500,0.0.f501,0.0.f502 > /sys/bus/ccwgroup/drivers/qeth/group ls /sys/bus/ccwgroup/drivers/qeth/0.0.f500 echo 1 > /sys/bus/ccwgroup/drivers/qeth/0.0.f500/online cat /sys/bus/ccwgroup/drivers/qeth/0.0.f500/online cat /sys/bus/ccwgroup/drivers/qeth/0.0.f500/if_name lsqeth enccw0.0.f500 znetconf -c znetconf -r f500

Persistently adding a qeth device cd /etc/sysconfig/network-scripts lsqeth -p cp ifcfg-enccw0.0.09a0 ifcfg-enccw0.0.0600 ip link set enccw0.0.09a0 qlen 2500

nmcli con show nmcli dev status

systemctl status NetworkManager

If NetworkManager is not running, you will see this response:

Active: inactive (dead)

systemctl start NetworkManager systemctl enable NetworkManager

ifconfig is obsolete ip link help ip addr help ip -s link ip link show

systemctl [start|stop|restart|status] network

modprobe --first-time bonding modprobe bonding

/etc/sysconfig/network-scripts

[root@kvm1awb network-scripts]# cat ifcfg-bond1
DEVICE=bond1
NAME=bond1
TYPE=Bond
BONDING_MASTER=yes
IPADDR=9.60.87.83
PREFIX=23
ONBOOT=yes
BOOTPROTO=none

modinfo bonding

[root@kvm1awb network-scripts]# modinfo bonding
filename:       /lib/modules/3.10.0-229.7.2.el7_1.kvmibm1_1_1.23.s390x/kernel/drivers/net/bonding/bonding.ko
alias:          rtnl-link-bond
author:         Thomas Davis, [email protected] and many others
description:    Ethernet Channel Bonding Driver, v3.7.1
version:        3.7.1
license:        GPL
rhelversion:    7.1
srcversion:     B5833882BBF259B6F1D4061
depends:
intree:         Y
vermagic:       3.10.0-229.7.2.el7_1.kvmibm1_1_1.23.s390x SMP mod_unload modversions
signer:         IBM Linux kernel signing key
sig_key:        4F:72:97:F6:6D:A4:4C:8F:EB:10:0C:B0:5E:84:1D:BE:E3:3F:E5:4C
sig_hashalgo:   sha512
parm:           max_bonds:Max number of bonded devices (int)
parm:           tx_queues:Max number of transmit queues (default = 16) (int)
parm:           num_grat_arp:Number of peer notifications to send on failover event (alias of num_unsol_na) (int)
parm:           num_unsol_na:Number of peer notifications to send on failover event (alias of num_grat_arp) (int)
parm:           miimon:Link check interval in milliseconds (int)
parm:           updelay:Delay before considering link up, in milliseconds (int)
parm:           downdelay:Delay before considering link down, in milliseconds (int)
parm:           use_carrier:Use netif_carrier_ok (vs MII ioctls) in miimon; 0 for off, 1 for on (default) (int)
parm:           mode:Mode of operation; 0 for balance-rr, 1 for active-backup, 2 for balance-xor, 3 for broadcast, 4 for 802.3ad, 5 for balance-tlb, 6 for balance-alb (charp)
parm:           primary:Primary network device to use (charp)
parm:           primary_reselect:Reselect primary slave once it comes up; 0 for always (default), 1 for only if speed of primary is better, 2 for only on active slave failure (charp)
parm:           lacp_rate:LACPDU tx rate to request from 802.3ad partner; 0 for slow, 1 for fast (charp)
parm:           ad_select:803.ad aggregation selection logic; 0 for stable (default), 1 for bandwidth, 2 for count (charp)
parm:           min_links:Minimum number of available links before turning on carrier (int)
parm:           xmit_hash_policy:balance-xor and 802.3ad hashing method; 0 for layer 2 (default), 1 for layer 3+4, 2 for layer 2+3 (charp)
parm:           arp_interval:arp interval in milliseconds (int)
parm:           arp_ip_target:arp targets in n.n.n.n form (array of charp)
parm:           arp_validate:validate src/dst of ARP probes; 0 for none (default), 1 for active, 2 for backup, 3 for all (charp)
parm:           fail_over_mac:For active-backup, do not set all slaves to the same MAC; 0 for none (default), 1 for active, 2 for follow (charp)
parm:           all_slaves_active:Keep all frames received on an interfaceby setting active flag for all slaves; 0 for never (default), 1 for always. (int)
parm:           resend_igmp:Number of IGMP membership reports to send on link failure (int)

We can search for all files that end in ".conf":

find / -type f -name "*.conf"

Linux Audit

[root@kvmawb audit-2.4.1]# auditctl -l
No rules
# aureport -f

File Report
===============================================
# date time file syscall success exe auid event
===============================================
1. 08/27/2016 03:27:31 / 5 no /usr/bin/ssh-keygen -1 15
2. 08/27/2016 03:27:32 / 5 no /usr/bin/ssh-keygen -1 191
3. 08/27/2016 03:27:32 / 5 no /usr/bin/ssh-keygen -1 209
4. 08/27/2016 03:27:33 lib 39 no /usr/sbin/ebtables -1 344
[root@bacenkvm2 audit-2.4.1]# aureport -f

File Report
===============================================
# date time file syscall success exe auid event
===============================================
1. 08/27/2016 03:27:31 / 5 no /usr/bin/ssh-keygen -1 15
2. 08/27/2016 03:27:32 / 5 no /usr/bin/ssh-keygen -1 191
3. 08/27/2016 03:27:32 / 5 no /usr/bin/ssh-keygen -1 209
4. 08/27/2016 03:27:33 lib 39 no /usr/sbin/ebtables -1 344
# aureport -f --summary

File Summary Report
===========================
total  file
===========================
3  /
1  lib

# aureport --summary

Summary Report
======================
Range of time in logs: 08/27/2016 03:27:31.293 - 08/27/2016 12:30:01.600
Selected time for report: 08/27/2016 03:27:31 - 08/27/2016 12:30:01.600
Number of changes in configuration: 1340
Number of changes to accounts, groups, or roles: 5
Number of logins: 3
Number of failed logins: 1
Number of authentications: 6
Number of failed authentications: 0
Number of users: 2
Number of terminals: 7
Number of host names: 3
Number of executables: 14
Number of commands: 55
Number of files: 2
Number of AVC's: 4
Number of MAC events: 4
Number of failed syscalls: 4
Number of anomaly events: 2
Number of responses to anomaly events: 0
Number of crypto events: 57
Number of integrity events: 0
Number of virt events: 0
Number of keys: 0
Number of process IDs: 1288
Number of events: 2078

Firewall

# firewall-cmd --get-active-zones
public
  interfaces: enccw0.0.570f

# firewall-cmd --zone=public --list-all
public (default, active)
  interfaces: enccw0.0.570f
  sources:
  services: dhcpv6-client ssh
  ports:
  masquerade: no
  forward-ports:
  icmp-blocks:
  rich rules:

Add port for FTP

firewall-cmd --zone=public --add-port 23/tcp --permanent

Add port for Live Guest Migration

firewall-cmd --zone=public --add-port 49125-49215/tcp --permanent
firewall-cmd --reload
# firewall-cmd --zone=public --add-port 23/tcp --permanent
success
# firewall-cmd --reload
success

results matching ""

    No results matching ""