Wednesday, December 2, 2020

Linux - Initial setting after Linux install

■ Register a user on the following file.
njoonk  ALL=(ALL)  ALL
$ cat /etc/sudoers
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.2
$ systemctl restart sshd
$ systemctl status sshd

■ Change a host name
@ Before
[root@localhost home]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
@ After
[root@localhost home]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos04
GATEWAY=192.168.11.1
Check hostname information
[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
@ After
[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 network
$ /etc/init.d/network restart

@ Set DNS
@ Before
[root@centos04 sysconfig]# cat /etc/resolv.conf
search centos04
@ After
[root@centos04 sysconfig]# cat /etc/resolv.conf
search centos04
nameserver 192.168.11.1

No comments:

Post a Comment