最近新入手了一个MacPro2016,需要配置很多东西。其中就包括的SSH。因为之前用Windows,使用的是Xshell客户端,跳板机什么的都正常操作。但是这次在Mac上像用同样的办法没有成功。调研了一番,问了一些SA大神及查阅了一些文档,基本上搞清楚问题原因。做笔记来记录下过程。
windows版跳板机的使用姿势,可以自行百度
跳板机的配置
通过上面的办法我选定了node1.org作为我的跳板机,配置如下:
hzlixiaolei@node1.org:~$ vi .bashrc
#add by Li Xiaolei
alias go-node1='ssh node1.org'
alias go-node2='ssh node2.org'
可以看到,node1可以调到所有的机器。
想象中Mac中的配置及出现的问题
因为Mac自带SSH客户端,所以初步的想法是:
ssh到node1
由node1跳板到任意机器。
然而失败了。
XiaoleideMacBook-Pro:~ professor$ vi .bashrc
alias go-node1='ssh -p 1046 hzlixiaolei@10.165.xxx.xxx'
XiaoleideMacBook-Pro:~ professor$ go-node1
-bash: go-node1: command not found
XiaoleideMacBook-Pro:~ professor$ source .bashrc
-bash: SSH_AUTH_SOCK=/var/folders/9x/7zl7w59n55s3wb_wjg7d5zfh0000gn/T//ssh-XpUY3kpYkJnP/agent.9483;: No such file or directory
XiaoleideMacBook-Pro:~ professor$ go-node1
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Feb 6 15:51:21 2017 from 10.165.xx.xx
hzlixiaolei@node1:~$go-node2
(public key denied)
如图所示,我从node1往node2跳的时候出现公钥无效。
解决办法
其实这里的问