VM FROM SCRATCH
VM FROM SCRATCH
1. /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eth0
UUID=b347ad6a-eaf1-4f81-ad64-6c762656abd1
DEVICE=eth0
ONBOOT=yes
IPADDR=172.18.23.65
NETMASK=255.255.255.0
GATEWAY=172.18.23.254
add the IP and HOSTName of the VM with the domain name (if exist)
ask Nadine to add it to DNS
Ciphers aes128-ctr,aes192-ctr,aes256-ctr
#,arcfour256,arcfour128,arcfour
MACs hmac-sha1,hmac-ripemd160
Protocol 2
ClientAliveInterval 1200
to rotate logs:
1. vi /etc/logrotate.conf
daily
rotate 4
create
dateext
compress
1 vi /etc/security/pwquality.conf
minlen = 8
dcredit = -1
ucredit = -1
lcredit = -1
ocredit = -1
maxrepeat = 3
2 vi /etc/login.defs
PASS_MAX_DAYS 45
PASS_MIN_DAYS 1
PASS_MIN_LEN 8
3 vi /etc/pam.d/system-auth
4 vi /etc/pam.d/password-auth
5 touch /etc/security/opasswd
6 chown root:root /etc/security/opasswd
7 chmod 600 /etc/security/opasswd
to add user
1 useradd karim.khalil
2 passwd karim.khalil
3 chage -d 0 karim.khalil
4 usermod karim.khalil -aG wheel
to add /data
1 fdisk -l
2 pvcreate /dev/sdb
3 vgcreate vg_data /dev/sdb
4 lvcreate -l 100%FREE -n data_lv vg_data
5 mkdir /data
6 mkfs.xfs /dev/vg_data/data_lv
7 mount /dev/vg_data/data_lv /data
8 df -h
9 vi /etc/fstab
10 umount /data
11 df -h
12 mount -a
13 df -h
14 cd /data
15 cd ..
16 ll
If Vm is production
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
vi /etc/snmp/snmpd.conf
This will set the server to listen on all IPv4 and IPv6 addresses (remove the ‘#’ in front of the
agentAddress, to enable it and comment agentAddress udp:127.0.0.1:161
vi /etc/rsyslog.conf
Rhel7
action(type="omfwd"
_____________________________________________________________________________
Rhel7
:q
Rhel7
-------------------------------------------------------------------------------
=================================================================================