让autossh随系统自动启动

可以使用systemd来让autossh自动启动,这样即使服务器重启后依然可以访问。

参考:https://pesin.space/posts/2020-10-16-autossh-systemd/ https://gist.github.com/thomasfr/9707568

具体:在/etc/systemd/system/目录下建立一个autossh.service文件,其内容如下:

cat autossh.service 

[Unit]
Description=AutoSSH tunnel service on local port 7192
After=network.target


[Service]
Environment=”AUTOSSH_GATETIME=0″
ExecStart=/usr/bin/autossh -M 0 -o “ServerAliveInterval 50” -o “ServerAliveCountMax 5” -o ExitOnForwardFailure=yes -i /home/user/.ssh/id_rsa -gCNR 7192:localhost:22 user@remote_host


[Install]
WantedBy=multi-user.target

已发布

分类

来自

标签:

评论

《 “让autossh随系统自动启动” 》 有 13 条评论

  1. cheapest buy androxal generic extended release

    discount androxal generic canada no prescription

  2. order enclomiphene purchase from uk

    cheap enclomiphene usa online pharmacy

  3. cheapest buy rifaximin price netherlands

    rifaximin mail order uk

  4. buying xifaxan generic low price

    get xifaxan price generic

  5. cheap staxyn australia buy online

    how to buy staxyn generic efficacy

  6. avodart delivered overnight

    how to order avodart usa seller

  7. cheapest buy dutasteride online no rx

    purchase dutasteride generic dutasteride

  8. flexeril cyclobenzaprine uk do you need prescription

    buy flexeril cyclobenzaprine buy in london

  9. get gabapentin canadian sales

    canadian gabapentin no prescription

  10. buy fildena cost at costco

    order fildena generic prices

  11. discount itraconazole usa pharmacy

    order itraconazole generic equivalent

  12. kamagra porovnat ceny walgreens

    kamagra austrテ。lie bez lテゥkaナ冱kテゥho pナ册dpisu

  13. comprar kamagra generico

    nuit kamagra ups livraison

回复 online order rifaximin generic cheap 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注