njoonk ALL=(ALL) ALL
$ cat /etc/sudoers
njoonk ALL=(ALL) ALL
njoonk ALL=(ALL) ALL
@ Disallowing Root Access
■ Edit the following file, set the PeritRootLogin parameter to no
PermitRootLogin no
$ vim /etc/ssh/sshd_config
PermitRootLogin no
sshd should be restared on CentOs8.2PermitRootLogin no
$ systemctl restart sshd
$ systemctl status sshd
$ systemctl status sshd
■ Change a host name
@ Before
[root@localhost home]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
@ AfterNETWORKING=yes
HOSTNAME=localhost.localdomain
[root@localhost home]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos04
GATEWAY=192.168.11.1
Check hostname information
NETWORKING=yes
HOSTNAME=centos04
GATEWAY=192.168.11.1
[root@localhost home]# hostnamectl
■ Edit hosts file@ Before
[root@localhost home]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
@ After127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@localhost home]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 centos04
192.168.11.23 centos04 localhost
■ Just restart the network127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 centos04
192.168.11.23 centos04 localhost
$ /etc/init.d/network restart
@ Set DNS
@ Before
[root@centos04 sysconfig]# cat /etc/resolv.conf
search centos04
@ Aftersearch centos04
[root@centos04 sysconfig]# cat /etc/resolv.conf
search centos04
nameserver 192.168.11.1
search centos04
nameserver 192.168.11.1
No comments:
Post a Comment