Linux系统入门学习:如何安装autossh
提问: 我打算在Linux上安装autossh,我应该怎么做呢?
autossh 是一款开源工具,可以帮助管理SSH会话、自动重连和停止转发流量。autossh会假定目标主机已经设定无密码SSH登陆,以便autossh可以重连断开的SSH会话而不用用户操作。
只要你建立反向SSH隧道或者挂载基于SSH的远程文件夹,autossh迟早会派上用场。基本上只要需要维持SSH会话,autossh肯定是有用的。
下面有许多linux发行版autossh的安装方法。
Debian 或 Ubuntu 系统
autossh已经加入基于Debian系统的基础库,所以可以很方便的安装。
<span class="pln">$ sudo apt</span><span class="pun">-</span><span class="kwd">get</span><span class="pln"> install autossh </span>
Fedora 系统
Fedora库同样包含autossh包,使用yum安装。
<span class="pln">$ sudo yum install autossh </span>
CentOS 或 RHEL 系统
CentOS/RHEL 6 或早期版本, 需要开启第三库Repoforge库, 然后才能使用yum安装.
<span class="pln">$ sudo yum install autossh </span>
CentOS/RHEL 7以后,autossh 已经不在Repoforge库中. 你需要从源码编译安装(例子在下面)。
Arch Linux 系统
<span class="pln">$ sudo pacman </span><span class="pun">-</span><span class="pln">S autossh </span>
Debian 或 Ubuntu 系统中从源码编译安装
如果你想要使用最新版本的autossh,你可以自己编译源码安装
<span class="pln">$ sudo apt</span><span class="pun">-</span><span class="kwd">get</span><span class="pln"> install gcc make</span>
<span class="pln">$ wget http</span><span class="pun">:</span><span class="com">//www.harding.motd.ca/autossh/autossh-1.4e.tgz</span>
<span class="pln">$ tar </span><span class="pun">-</span><span class="pln">xf autossh</span><span class="pun">-</span><span class="lit">1.4e</span><span class="pun">.</span><span class="pln">tgz</span>
<span class="pln">$ cd autossh</span><span class="pun">-</span><span class="lit">1.4e</span>
<span class="pln">$ </span><span class="pun">./</span><span class="pln">configure</span>
<span class="pln">$ make</span>
<span class="pln">$ sudo make install </span>
CentOS, Fedora 或 RHEL 系统中从源码编译安装
在CentOS/RHEL 7以后,autossh不在是预编译包。所以你不得不从源码编译安装。
<span class="pln">$ sudo yum install wget gcc make</span>
<span class="pln">$ wget http</span><span class="pun">:</span><span class="com">//www.harding.motd.ca/autossh/autossh-1.4e.tgz</span>
<span class="pln">$ tar </span><span class="pun">-</span><span class="pln">xf autossh</span><span class="pun">-</span><span class="lit">1.4e</span><span class="pun">.</span><span class="pln">tgz</span>
<span class="pln">$ cd autossh</span><span class="pun">-</span><span class="lit">1.4e</span>
<span class="pln">$ </span><span class="pun">./</span><span class="pln">configure</span>
<span class="pln">$ make</span>
<span class="pln">$ sudo make install </span>
相关推荐
farwang 2020-11-25
星愿心愿 2020-11-24
tianhuak 2020-11-24
zhjn0 2020-11-24
昭君出塞 2020-11-23
bluecarrot 2020-11-23
linuxwcj 2020-10-21
以梦为马不负韶华 2020-10-20
彼岸随笔 2020-10-20
yutou0 2020-10-17
applecarelte 2020-10-16
ourtimes 2020-10-16
waterhorse 2020-09-19
MRFENGG 2020-11-11
rainandtear 2020-10-30
kyssfanhui 2020-10-20
liuhangtiant 2020-10-20