1. administratively prohibited: open failed

用 SSH 打了一个洞,然后发现这个错误:

[[email protected] ~]# ssh [email protected] -D 0.0.0.0:9999
channel 2: open failed: administratively prohibited: open failed
channel 3: open failed: administratively prohibited: open failed
channel 4: open failed: administratively prohibited: open failed
channel 5: open failed: administratively prohibited: open failed
channel 4: open failed: administratively prohibited: open failed
channel 5: open failed: administratively prohibited: open failed
channel 4: open failed: administratively prohibited: open failed
channel 5: open failed: administratively prohibited: open failed
channel 16: open failed: administratively prohibited: open failed
channel 17: open failed: administratively prohibited: open failed

查看一下错误日志:

[[email protected]]# tailf /var/log/secure
Jul 28 21:15:46 bwg sshd[5158]: error: connect_to driver.google.com: unknown host (Name or service not known)
Jul 28 21:15:46 bwg sshd[5158]: error: connect_to driver.google.com: unknown host (Name or service not known)
Jul 28 21:15:47 bwg sshd[5158]: error: connect_to driver.google.com: unknown host (Name or service not known)
Jul 28 21:15:47 bwg sshd[5158]: error: connect_to driver.google.com: unknown host (Name or service not known)
Jul 28 21:15:48 bwg sshd[5158]: error: connect_to driver.google.com: unknown host (Name or service not known)

嗯,域名写错了,那肯定访问不通的,应该是 drive.google.com

2. 通过跳板机访问内部机器

[[email protected]]# ssh [email protected]目标机器ip -p 22 -o ProxyCommand='ssh -p 22 [email protected]跳板机ip -W %h:%p'

3. 通过跳板机(隧道)传输文件

[[email protected]]# ssh -L 1234:<address of R known to G>:22 <user at G>@<address of G> 
[[email protected]]# echo "请打开另外一个终端"
[[email protected]]# scp -P 1234 <user at R>@127.0.0.1:/path/to/file file-name-to-be-copied