Tuesday, April 28, 2020

How to assign IP address on linux system(Centos, RHEL7)


Today we are going to learn static  & automatic IP assignment. In centos or RHEL7 hostname -I command is used to check ip address of a system. There are 2 different types of IP addresses,  IPV4 & IPV6. Let's learn how to set it on system.
We are considering you have already install virtual box or vmware on your windows operating system. Then, Install linux like centos7 which is freely available on internet.
nmtui command is used to assign ip address in a graphical way. In our practical we are going to learn command line interface to assign ip address.
nmcli connection show - This command shows adapter or network interface. 
You will get interface name by using ip addr command. here, interface name is enpos3

nmcli connection mod "enp0s3" ipv4.method manual ipv4.address 192.168.1.1/24

nmcli stands for network management command line interface, enp0s3 is the name of interface you will get the name of interface by using ifconfig or ip addr command. we want to assign ipv4 version for assigning the IP address so ipv4.method. We are assigning the ip manually that's why manual.Then assign ip address as 192.168.1.1 by following ipv4.address, /24 indicates class c. There are 5 types of IP classes available. Im which only 3 are useful for us.
Then use nmcli con down enp0s3 to down the ethernet interface. Next use nmcli conn up enp0s3 command to open up connection.


Now, check ip address of your system by using ip addr command.


Thanks for reading the above article. If you have any query , Please feel free to contact on email id zurangechaitali13@gmail.com

How to set hostname on your system


Dear friends, today we are going to learn 2 different ways to set hostname.
1st method
hostnamectl set-hostname server.linuxlearning.com
You can set any hostname  by using above mentioned command. Give any hostname in the place of server.linuxlearning.com as per your mind.

2nd method
By editing configuration file /etc/hostname
Edit the file by using vi /etc/hostname Then enter a hostname as server.linuxlearning.com

After saving file reboot  the system by using reboot command.

Check hostname by using hostname command.
Hostname is the command to check hostname of a system. Hostname -I is used to check the IP address of a system.


Hostname -d is used to check domain name of a system.



Hostname -f is used to check fully qualified domain name (FQDN) of a system.


We can also set the hostname by using graphical user interface(GUI) 
Use command nmtui & press enter. You will get window as shown below. Click on Set System hostname. 


Press Enter & type hostname you want to set. here we have set hostname as server.linuxlearning.com             



Thanks for reading the above article . Please feel free to send your queries on zurangchaitali13@gmail.com.

Monday, April 27, 2020

How to change root password in centos7 or RHEL7


Today, we are going to learn at any case we forgot root password then how to change it. During RHCSA examination they  will provide you a system where root password is needed to change. Its a first step of the examination. Every administrator should know it by default.

Lets, see steps to change root password on centos7 system.

i) Reboot the server by pressing reboot command , when you will see image like below




then press e to edit the file.

ii) write rd.break into the kernel file after UTF-8 as given into image.


iii)Then press ctrl+x to come out from kernel file.

iv)Press mount command you will see that kernel file has only read only permission.




vi) Type chroot /sysroot then press enter.






vii) write passwd command & press enter





you will get prompt for entering new password . Enter password two times.



after entering password you will get below message.




viii)write command touch /.autorelabel







Then type exit then enter. again type exit & enter.








after that automatically server  will turn on. you will get login prompt. you can login by using updated password as shown in below image.










Thanks for reading the above learning & sharing document. If you have any query please feel to contact on mail id as zurangechaitali13@gmail.com