首页 技术 正文
技术 2022年11月8日
0 收藏 334 点赞 1,708 浏览 826 个字

在本地机器 1)ssh-keygen 2)ls ~/.ssh/ 应该有三个文件id_rsa id_rsa.pub known_hosts 拷贝id_rsa.pub到远程服务器,然后在远程服务器运行3) cat id_rsa.pub >> ~/.ssh/authorized_keys 验证不需要输入密码就可以ssh从本地到远程 本地机器 4)解压缩附件的autossh5) 编译下载地址:http://www.wudonghang.com/downloads/autossh/autossh-1.4c.tgz  或 ftp://www.wudonghang.com/downloads/autossh/autossh-1.4c.tgz具体步骤如下

  • gunzip -c autossh-1.4c.tgz | tar xvf –
  • cd autossh-1.4c
  • ./configure
  • make all
  • make install

安装完了,应该在/usr/local下面 运行autossh -f -M 5678 -NR 10000:localhost:22 root@x.x.x.xx.x.x.x是远程服务器10000是连接端口5678是监控端口 运行完毕后,登录到远程服务器 然后运行 ssh localhost -p 10000就可以反向连接了。   信息 本地端  /usr/local/bin/autossh -f -M 5678 -NR 10000:localhost:12222 -p12222 root@182.92.130.221远程端访问(用的saltstack) ssh wudonghang@localhost -p 10000有时候 -f不好使 autossh  -M 5678 -NR 10000:localhost:12222 root@220.171.106.6 -p 43322&加入PATHA环境变量,/etc/profile里面搜索patc 加 :/usr/local/bin/autossh 来自为知笔记(Wiz)

附件列表

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,492
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,494
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,295