Linux修改hostname与免密码登录的方法
修改hostname
[root@centos7 ~]$ hostnamectl set-hostname hadoop001 # 使用这个命令会立即生效且重启也生效 [root@centos7 ~]$ hostname # 查看下 hadoop001 [root@centos7 ~]$ vim /etc/hosts # 编辑下hosts文件, 给127.0.0.1添加hostname [root@centos7 ~]$ cat /etc/hosts # 检查 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 hadoop001 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
免密码登录
scp id_rsa.pub [email protected]:/home/lau/.ssh/pub_key #登录用户 cd ~/.ssh/ cat pub_key >> authorized_keys chmod 600 /home/lau/.ssh/authorized_keys
总结
以上所述是小编给大家介绍的Linux修改hostname与免密码登录的方法,希望对大家有所帮助,如果大家有任何疑问欢迎给我留言,小编会及时回复大家的!
相关推荐
farwang 2020-11-25
星愿心愿 2020-11-24
tianhuak 2020-11-24
zhjn0 2020-11-24
昭君出塞 2020-11-23
bluecarrot 2020-11-23
linuxwcj 2020-10-21
以梦为马不负韶华 2020-10-20
彼岸随笔 2020-10-20
yutou0 2020-10-17
applecarelte 2020-10-16
ourtimes 2020-10-16
waterhorse 2020-09-19
MRFENGG 2020-11-11
rainandtear 2020-10-30
kyssfanhui 2020-10-20
liuhangtiant 2020-10-20