![]() |
|||||||||
![]() |
![]() |
autossh の変更点
#author("2018-04-17T04:50:54+00:00","default:pentacle","pentacle") #author("2025-03-17T15:31:10+09:00","default:pentacle","pentacle") 簡易的な VPN として rev ssh tunnel を使う ※当然ながら双方のネットワークにかなり大きな穴をあけることになるので、自分が管理するネットワーク同士でのみで使うこと * 踏み台サーバにて [#a8221a6f] basiton.inside.com とする *** パスなしログインユーザの作成 [#t32fbba5] adduser bastion su bastion cd ssh-keygen -t rsa -b 4096 mv .ssh/id_rsa.pub .ssh/authorized_keys chmod -R 600 .ssh * クライアントマシンにて [#vbe74ae9] dhcp1.outside.com とする yum install autossh adduser bastion su bastion cd mkdir .ssh 先ほど作った踏み台サーバの id_rsa を .ssh 以下に置く ''/etc/rc.local'' ''/etc/crontab'' @reboot root /root/rev.sh ''/root/rev.sh'' #pre{{ #!/bin/bash /usr/bin/autossh -f -N -M 3023 -i /home/bastion/.ssh/id_rsa -R 8022:localhost:22 basiton.inside.com sudo -u bastion /usr/bin/autossh -f -N -M 3023 -R 8022:localhost:22 bastion.inside.com }} |
|||||||