栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

ubuntu18.04 ssh拷贝密钥失败

ubuntu18.04 ssh拷贝密钥失败

问题描述:

生成密钥拷贝到远程电脑命令ssh-copy-id root@远程电脑ip 失败,出现了:/etc/ssh/ssh_config line 52: Unsupported option “rsaauthentication” /etc/ssh/ssh_config: line54: Bad configuration option: permitrootlogin /etc/ssh/ssh_config:terminating, 1 bad configuration options

解决方案:

vim /etc/ssh/ssh_config
修改一下下面两个设置就可以了

#RSAAuthentication yes
 #PermitRootLogin yes

另外我在/etc/ssh/sshd_config修改了:

PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
免密ssh的过程

我是为了搭建hadoop集群,才搞的这个免密登录,机器准备

  1. 操作系统
    配置两台机器:ubuntu18.04, Centos 7.x ,ip 设置: 192.168.31.9
    192.168.31.10
    两台机器的/etc/hosts文件都设置了别名,分别如下:
 192.168.31.9     hj
 192.168.31.10   xj
  1. 生成密钥
ssh-keygen -t rsa  然后一直按enter

cd /root/.ssh就可以看到两个文件了:id_rsa,id_rsa.pub

  1. authorized_keys:存放远程免密登录的公钥,主要通过这个文件记录多台机器的公钥(初始不存在该文件) *
  2. id_rsa : 生成的私钥文件 *
  3. id_rsa.pub : 生成的公钥文件*
  4. know_hosts : 已知的主机公钥清单*(初始也不产生)

直接命令:

在/root/.ssh文件夹下: ssh-copy-id root@对方的Ip 
在31.10机器上: ssh-copy-id root@192.168.31.9
在31.9机器上:   ssh-copy-id root@192.168.31.10
 也可以:
 如果在hj/31.9的话          ssh-copy-id  xj
 如果在xj/31.10的话          ssh-copy-id  hj

参考:
https://blog.csdn.net/u013415591/article/details/81943189

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/687718.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号