ubuntu 14.04:autossh反向代理设置并加入开机启动
2018-01-15 18:51
477 查看
下载autossh。
然后是要设置利用密钥登陆。
最关键和另外最迷茫的一步是设置开机自启动。。因为是ubuntu 14。所以systemctl没法用。所以就制作成服务吧。。
vim /etc/init/autossh.conf
然后就可以利用service autossh start了
具体参考如下
description "autossh daemon for ssh tunnel"
start on
net-device-up IFACE=eth0
stop on
runlevel [01S6]
setuid usr_name
respawn
respawn limit 5 60
script
export AUTOSSH_FIRST_POLL=30
export AUTOSSH_GATETIME=0
export AUTOSSH_POLL=60
autossh -M
6777 -NR
2222:localhost:22 【远程ip】-i /home/usr_name/.ssh/id_rsa
end script
因为当初没有设置setuid。所以一直无法使用我本地的私钥。。。坑~~
然后是要设置利用密钥登陆。
最关键和另外最迷茫的一步是设置开机自启动。。因为是ubuntu 14。所以systemctl没法用。所以就制作成服务吧。。
vim /etc/init/autossh.conf
然后就可以利用service autossh start了
具体参考如下
description "autossh daemon for ssh tunnel"
start on
net-device-up IFACE=eth0
stop on
runlevel [01S6]
setuid usr_name
respawn
respawn limit 5 60
script
export AUTOSSH_FIRST_POLL=30
export AUTOSSH_GATETIME=0
export AUTOSSH_POLL=60
autossh -M
6777 -NR
2222:localhost:22 【远程ip】-i /home/usr_name/.ssh/id_rsa
end script
因为当初没有设置setuid。所以一直无法使用我本地的私钥。。。坑~~
相关文章推荐
- ubuntu14.04 设置开机启动到命令行模式
- Ubuntu 14.04设置开机启动脚本的方法
- Ubuntu14.04 设置开机自启动方法
- ssh到Ubuntu安装realvnc并加入自动启动和设置密码
- Ubuntu14.04设置开机启动脚本
- ubuntu + windows 双系统设置开机默认启动的系统
- Linux-----Ubuntu设置开机启动模式
- Ubuntu下设置tomcat为服务(开机启动)
- ubuntu设置开机启动图形应用程序,替换默认图形桌面
- ubuntu设置开机启动图形应用程序,替换默认图形桌面
- ubuntu设置服务开机启动
- Ubuntu windows双系统设置开机默认启动系统
- ubuntu 设置activemq开机启动
- ubuntu 设置Path 开机启动脚本
- ubuntu中设置synergy自动开机启动
- Ubuntu14.04设置启动进入字符界面
- ubuntu系统设置开机启动进入文本模式
- Linux-----Ubuntu设置开机启动模式
- ubuntu14.04下安装反向代理工具nginx遇到的问题
- Ubuntu 14.04 LTS下设置命令模式和开启ssh