Friday, January 11, 2019

Few Linux System Administrator "One Liners"


Some common frequently needed commands:


  • Change the hostname everywhere in CentOS/RHEL7:

# hostnamectl --static set-hostname idm-auth-admin-lkf-noc03

# systemctl restart systemd-hostnamed

  • To update the ntpd with the timeserver:
# ntpdate -u  time_server_ip

# ntpq -np

  • RHEL7 client registration with RHN network.
# subscription-manager register --username --password  secret --auto-attach

  • DNS record queries - forward and reverse

DNS records quarry for Linux host:

[root@idm ~]# dig +short idm.lab.example.com A
172.25.250.8

[root@idm ~]# dig +short -x 172.25.250.8
idm.lab.example.com.

grep -w(hostname) /etc/hosts




No comments: