Intervie Que Linux
Intervie Que Linux
===================================================================================
====
===================================================================================
====
Components of LVM
There are three main components to LVM:
Physical Volumes
Volume Groups
Logical Volumes
pvdisplay -- TO DISPLAY PV
# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created.
# pvdisplay
OR
# pvdisplay /dev/sdb1
# mkfs.ext4 -m 0 /dev/mynew_vg/vol01
# nano /etc/fstab
Mount logical volumes
In order to use our new volumes, we’ll need to mount them. Don’t forget to also
create the mount point first.
# mkdir /foobar
# mount -a
To make the filesystem grow and use the added space we need to resize the
filesystem with the following command.
# resize2fs /dev/mynew_vg/vol01
# lvremove /dev/mynew_vg/vol02
===================================================================================
====
df -hT /var/
ls -lrth /var/log/messages
===================================================================================
====
vi /etc/hosts
# cd /etc/sysconfig/network-scripts
#ls
#vi ifcfg-ens192
:wq!
#ifup ifcfg-ens192
#pwd
#ifup ifcfg-ens192
#ifdown ifcfg-ens192
ifconfig-a
=============================================================
vi /etc/fstab
Access issue :
id thjoescggs
/opt/quest/bin/vastool user checkaccess thjoescggs
/opt/quest/bin/vastool user checkaccess thjoescggs
pam_tally2 -u thjoescggs
pam_tally2 -u thjoescggs -r
===================================================================================
============================
# sestatus
3) check firewall service , it should be dead , if not , please check further with
SMEs
4) check ip
# ifconfig
===================================================================================
============================
ip a
cat /etc/sysconfig/network-scripts/ifcfg-ens224
vi /etc/sysconfig/network-scripts/ifcfg-ens224
systemctl restart NetworkManager
nmcli connection show
ip a
try to ping
===================================================================================
==============================
check nectwork manager
ip a
ifconfig
cat ls /etc/sysconfig/network-scripts
/etc/sysconfig/network-scripts/ifcfg-ens224
=======================================================
Run below command before reboot
grub2-mkconfig -o /boot/grub2/grub.cfg
=========================================================
IP forwarding should usually be turned off if you’re not using one of the
aforementioned configurations. You typically don’t want your system wasting
bandwidth or resources to forward packets elsewhere, unless it’s been designed to
do that job. Using the net.ipv4.ip_forward kernel setting to control IP forwarding
will ensure that you have full control over your packets. This setting will
override all other firewall and software settings.
command below :
# cat /etc/sysctl.conf
#vi /cat/etc/sysctl.conf
And change the value
==================================================================
$ ssh-keygen -t rsa
Note: By default, ssh-keygen command generate keys of size 2048 bits. If you wish
to change the size of keys, then use ‘-b’ option followed by size in bits. Example
is shown below,
Now that you have generated the SSH keys, you need to copy the public key to the
remote server where you want to set up passwordless SSH login. Use ‘ssh-copy-id‘
command to copy user’s public key to remote system.
Syntax:
$ ssh-copy-id <user-name>@<Remote-Linux-System-IP>
$ ssh-copy-id [email protected]
$ ssh [email protected]
===================================================================================
========
cronjob
Start by checking whether the current user has any scheduled jobs:
$ crontab -l
00 23 * * * localuser rsync -av /home/localuser/source
/home/localuser/destination
00 12 * * 6 localuser cp -R /home/localuser/destination/* /home/localuser/full/
To edit the crontab file for the current user, use the command:
crontab -e
-----------------------------------------------------------------------------------
-------------------------
Read ® = 4
Write (w) = 2
Execute (x) = 1
===================================================================================
==========================
Changing Ownership
Use the chown command to change the owner and group of a file or directory.
===================================================================================
==========================
Change hostname
vi /etc/hosts
remove old hostname and IP address & add NEWHOSTNAME AND IP
153.88.95.224 osekilx0606v.int.se.nmc.ericsson.se osekilx0606v
:wq!
#systemctl restart NetworkManager
# cd /etc/sysconfig/network-scripts
#ls
#vi ifcfg-ens192
IPADDR= add NEW IP
NETMASK= remove old netmaks and add new netmask
GATEWAY= remove old gateway and add NEw gateway
:wq!
#ifup ifcfg-ens192
#pwd
#systemctl restart Networkmanager
#ifup ifcfg-ens192
#ifdown ifcfg-ens192
ifconfig-a