如何通过Master登录DC-OS slave

How to login into DC-OS slave through Master

我在 azure 上创建了 DC-OS 集群,在使用 ssh public 密钥创建后,我可以使用以下命令访问 master, sudo ssh -v -A -p 2200 user@master-ip -i /root/.ssh/id_rsa

进入主节点后我想访问代理,所以我将 id_rsa 和 id_rsa.pub 密钥从主机复制到主节点。 和 运行 以下命令。

ssh -p 22 10.32.0.4 debug1:没有更多的身份验证方法可以尝试。 权限被拒绝(public 键)

但不幸的是它会给出以下错误,我尝试了很多方法但没有ssh进入药膏。

我们可以按照以下步骤访问 SSH 代理:
1.上传私钥给master,我上传私钥(222222)到这个目录:

root@dcos-master-B9E522B-0:/home/jason/.ssh# pwd
/home/jason/.ssh
root@dcos-master-B9E522B-0:/home/jason/.ssh# ls
222222  authorized_keys  known_hosts
root@dcos-master-B9E522B-0:/home/jason/.ssh# 

2.更改此私钥的权限,更改为600:

jason@dcos-master-B9E522B-0:~/.ssh$ ll -a
total 20
drwx------ 2 jason jason 4096 Apr 27 02:39 ./
drwxr-xr-x 4 jason jason 4096 Apr 27 02:39 ../
-rw-rw-r-- 1 jason jason 1675 Apr 27 02:38 222222
-rw------- 1 jason jason  381 Apr 27 02:17 authorized_keys
-rw-r--r-- 1 jason jason  222 Apr 27 02:35 known_hosts
jason@dcos-master-B9E522B-0:~/.ssh$ chmod 600 222222 

3.Use SSH 代理的密钥:

jason@dcos-master-B9E522B-0:~/.ssh$ ssh jason@10.32.0.4 -i /home/jason/.ssh/222222 
ssh: /opt/mesosphere/lib/libcrypto.so.1.0.0: no version information available (required by ssh)
ssh: /opt/mesosphere/lib/libcrypto.so.1.0.0: no version information available (required by ssh)
Welcome to Ubuntu 16.04 LTS (GNU/Linux 4.4.0-28-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

0 packages can be updated.
0 updates are security updates.



The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

jason@dcos-agent-private-B9E522B000000:~$ 

:
1.We 可以使用 CLI 2.0 找到 VMSS 的实例管理员用户名,与您的主管理员用户相同的名称:

C:\Users>az vmss list-instances -n "dcos-agent-private-B9E522B-vmss0" -g dcos
"osProfile": {
      "adminPassword": null,
      "adminUsername": "jason",
      "computerName": "dcos-agent-private-B9E522B000000",

2.Also我们应该检查私钥权限,我们应该将其设置为600.
3.Make确定.ssh目录权限为700755.

drwx------ 2 jason jason 4096 Apr 27 02:39 .ssh/