Ubuntu Server系统基础配置

Ubuntu Server系统基础配置

 1:更改主机名:

1 ~$ cat /etc/hostname
2 ubuntu-node.example.com
View Code

2:配置root远程登录

默认情况下,ubuntu不允许root用戶远程ssh,如果有实际场景需要允许root用戶远程ssh,则需要设置root密码,并且编辑/etc/ssh/sshd_config文件修改如下

~$ sudo vim  /etc/ssh/sshd_config
32#PermitRootLogin prohibit-password #默认为禁止登录
33 PermitRootLogin yes#改为允许登录

57#PasswordAuthentication yes
58 PasswordAuthentication yes#打开密码认证,其实默认就是允许通过密码认证登录~

$ sudosu- root #切换到root用戶环境
~# passwd  #设置密码Enter new UNIX 
password:Retype new UNIX password:
passwd: password updated successfully

~# systemctl  restart  sshd #重启ssh服务并测试root用戶远程ssh连接

  

 
 

猜你喜欢

转载自www.cnblogs.com/molson/p/13195849.html
今日推荐