私のオフィスのコンピュータにアクセスするには、現在次のことを行っています。
me@home:~$ ssh unix.university.com
me@unix:~$ ssh unix.department.univeristy.com
[email protected]:~$ ssh office-machine.department.university.com
me@office-machine:~$ echo "This is very annoying"
このプロセスを自動化する簡単な方法はありますか?最後にコマンドを使用できますか?
ベストアンサー1
はい、SSH ProxyCommandとnetcatを使用してこれを行う良い方法があります。
.ssh/configにこのようなものを置きます。
Host *.department.university.com
User me
ForwardAgent yes
ProxyCommand ssh unix.university.com nc %h %p
その後、ジャンプ/要塞ホストunix.university.comを使用して.department.university.comサーバーに直接ログインします。 unix.university.com スタンザを指示する必要があるかもしれません。
動作方法を説明するリンクは次のとおりです。http://backdrift.org/transparent-proxy-with-ssh
この手法では、次のように書くことができます。
ssh unix.department.university.com
すべてが簡単に表示されます。 rsync、scpなどのツール(sshスタック内のすべての項目)も透過的に機能します。