Questions tagged [autossh]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
24 views

Forward webpage from local network of remote device through reverse SSH tunnel

I have an IPTV camera in a remote network. It has an HTML page for changing it's parameters. In this network I also have a linux server (Ubuntu 22.04) with already confugured autossh to my VDS (so I ...
Tony's user avatar
  • 1
0 votes
2 answers
236 views

Can a SSH reverse tunnel accept non-local connections?

I have a server in my office behind a firewall, a home server behind NAT, and a laptop I carry around. Sometimes I want to reach the office server from home so I did the following setup. Home router ...
Atilla Filiz's user avatar
0 votes
1 answer
777 views

Start a service and Run/load a script with ssh or autossh, remote port forwarding in the background "-f" to execute more/next commands in the script!

My config: debian 10.9 4.19.0-19-amd64 OpenSSH_7.9p1 Debian-10+deb10u2, OpenSSL 1.1.1d 10 Sep 2019 autossh 1.4g GNU bash, 5.0.3(1)-release (x86_64-pc-linux-gnu) I start a service in /etc/systemd/...
Z0OM's user avatar
  • 2,989
0 votes
1 answer
442 views

autossh always exits in error

I've aliased ssh to autossh -M0 for convenience, and it works well. However it always exits in error, which causes problems with my scripts. e.g. ssh me@myserver 'true' # equivalent to: autossh -...
lonix's user avatar
  • 1,669
0 votes
1 answer
386 views

Autossh is not working the same locally than on a remote server

If I start autossh on my local machine as follow: autossh -M 20000 -f - nNT -L 192.168.144.1:5433:127.0.0.1:5432 remote-user@remote-server-B it automatically launches the following ssh command under ...
s.k's user avatar
  • 429
1 vote
1 answer
715 views

Autossh options not consistent with what is in its man page?

I have kind of a naive question, but by reading this thread for example: https://superuser.com/questions/37738/how-to-reliably-keep-an-ssh-tunnel-open One can see in the accepted answer how to use ...
s.k's user avatar
  • 429
1 vote
1 answer
672 views

ssh reverse tunnel works, autossh does not

I have to access an openvpn-vpn server behind a firewall, so to do this I use an ssh-reverse tunnel. While using the "normal" ssh command works, connecting via autossh does not. For all the ...
Hermann Straßberger's user avatar
1 vote
0 answers
847 views

automatically reset sshfs when it locks up, remount fails unless done manually

i have 2 local dirs on my server mounted on a remote server. Local maintains connections with autossh -M 23 -R 24:localhost:22 user@server While remote mounts with dirs-sshfs.sh sshfs -o reconnect,...
greenvironmentalist's user avatar
3 votes
1 answer
2k views

SSH Tunnel with automatic reconnect and password auth in Docker container

I want to forward a Socks5 proxy using SSH with password authentication inside a Docker container. YES, I know that SSH keys would be better. But since it's not my own server, I'm not able to use keys,...
Lion's user avatar
  • 329
1 vote
1 answer
365 views

autossh system script fails at boot, works on systemctl restart

I am trying to set up an autossh service to forward ports to a remote server when my monitoring server boots. After some finagling, I got a pretty barebones system script working, with one catch. The ...
samh's user avatar
  • 131
0 votes
0 answers
100 views

autossh configuration for accessing a system in private subnet

Want to set up a proxy to access a system in a private subnet. We have a system A in our Office network. System B and System C are in cloud. System B has a public IP. Need to access System C in Cloud....
Hemanth Sundareshan's user avatar
-1 votes
1 answer
494 views

autossh just does ssh; where is the magic?

I did autossh -L 5901:localhost:5901 general and got just command shell of general machine. Tunneling was working. After I exited the shell, tunnel was closed. What is the difference with just ssh? ...
Dims's user avatar
  • 3,225
1 vote
1 answer
1k views

Remote port forwarding with autossh from Raspberry PI to VPS in order to access the PI from anywhere on the Internet, why does it work only once?

I am using autossh with remote port forwarding from VPS to Raspberry PI in order to be able to access the PI from anywhere on the Internet, but it works only once. I have a Raspberry PI 2 (Raspbian, ...
Jeff.D's user avatar
  • 21
1 vote
1 answer
263 views

setup consistent tunnel between two hosts wirh dynamic IPs

I would like to setup a constant ssh tunnel between two hosts. Now it becomes tricky as both hosts may change their IPs (not at the same time though). My idea to overcome this is to have two reverse ...
stdcerr's user avatar
  • 2,049
5 votes
5 answers
2k views

Autossh fails on startup

I am trying to make autossh set up a reverse tunnel to a server I have at home automatically with systemd. I set up a unit in /etc/systemd/system called autossh.service It all works fine if I start ...
Sofía Marlasca Aparicio's user avatar
1 vote
0 answers
226 views

autossh creating many processes every time

I'm using autossh to connect to a reverse SSH tunnel. I run it from startup. However, I was facing problems in that the tunnel sometimes goes down. I created a script which checks if the tunnel is ...
Engineer999's user avatar
  • 1,121
2 votes
1 answer
2k views

(root) Warning: Identity file /dev/fd/62 not accessible: No such file or directory

Very similar to Failed to open config file '/dev/fd/63', error: No such file or directory for wpa_supplicant except for the fact that I am running as root. bash-4.4# autossh -v -M 0 -4 -o ...
Elijah Lynn's user avatar
1 vote
0 answers
757 views

how to close/reuse ssh LocalForward ports

I need to ssh to multiple hosts having this configuration: Protocol 2 ExitOnForwardFailure yes ServerAliveCountMax 1 ServerAliveInterval 3 TCPKeepAlive no ControlMaster auto ControlPath ~/.ssh/...
nbari's user avatar
  • 606
0 votes
2 answers
1k views

Creating persistent netcat link

I have a remote raspberrypi that uses autossh to connect to my local machine (with reverse tunnel -R). This should feed a dump1090 instance on my local machine. I'm using /bin/nc localhost 40005 | /...
Pavel T's user avatar
  • 21
0 votes
1 answer
2k views

Reverse tunnel with autossh exits with 255

It seems since autossh changed their syntax, I am a bit overstrained in establishing a reverse ssh tunnel via autossh with my server. This is the script I am trying to run: autossh -M 20000 -f -N -R ...
t3ngu's user avatar
  • 115
2 votes
0 answers
380 views

launch reverse tunnel on init with autossh in the background

I need an init script which will establish a reverse tunnel connection to a server. I've come up with the following start script: #! /bin/sh ### BEGIN INIT INFO ### END INIT INFO case "$1" in ...
stdcerr's user avatar
  • 2,049
1 vote
1 answer
1k views

launch reverse tunnel with autossh on bootup in Ubuntu

I would like to launch a ssh reverse tunnel on system launch. The following line let's me establish the tunnel fine - but I end up being logged into server which I don't want, especially not from an ...
stdcerr's user avatar
  • 2,049
2 votes
0 answers
315 views

Automating autossh?

Adding ControlMaster auto ControlPath ~/.ssh/sockets/%C ControlPersist yes to ~/.ssh/config automatically creates a control connection that stays alive for a long time. This works at home where ...
chx's user avatar
  • 850
0 votes
1 answer
811 views

Setting autossh tunnels

We have server with installed autossh Number of tunnels approximately 20 Today we add new tunnel, but it doesn't work. If we switch positioning of [email protected] and [email protected], the one ...
useresxi's user avatar
20 votes
2 answers
6k views

Is autossh redundant with systemd?

When creating a persistent reverse SSH tunnel, is autossh useful on a system running systemd? Typically, autossh is run by a service with the option -M set to zero which disables monitoring of the ...
Guy's user avatar
  • 331
3 votes
2 answers
2k views

AutoSSH cannot resolve hostname directly after boot

I want to set up a tunnel to my home server which will be established right after my machine boots. Using this answer, I've got my autossh command set up inside a service, which has been set to run at ...
Top Cat's user avatar
  • 181
1 vote
0 answers
1k views

systemd: autossh service active but ssh exited with error

#/lib/systemd/system/autossh.service [Unit] Description=Auto Reverse SSH Requires=systemd-networkd-wait-online.service After=systemd-networkd-wait-online.service [Service] Type=forking ExecStart=/...
dstonek's user avatar
  • 189
1 vote
0 answers
183 views

autossh wrapper for reliability

There are a few servers spread around the globe who reverse ssh into a jumpbox to expose certain ports. The autossh process is usually evoked on these boxes at the startup using rc.local Here are the ...
user1263746's user avatar
0 votes
1 answer
3k views

Reverse SSH tunnel with AutoSSH

How to apply dynamic port allocation in AutoSSH? In the remote device using ssh we make a reverse tunnel by this command: ssh -f -N -R 0:localhost:22 username@ip It allocates a dynamic port on the ...
Shubham Pandey's user avatar
2 votes
2 answers
4k views

autossh not working on rc.local

I configured a reverse ssh tunnel through machines A (local, behind several routers) B (middlemen) and C (remote, the one I'm trying to access A from) After putting all relevant keys on all machines, ...
alonso s's user avatar
  • 121
0 votes
1 answer
997 views

Auto-SSH works manually but not in background

I'm running the following script on @reboot cron with root: autossh -f -i /home/pi/.ssh/myRemote.pem -R 2210:localhost:22 [email protected] When I run manually it works fine but from cron I see it ...
Philip Kirkbride's user avatar
0 votes
0 answers
154 views

Why does Autossh work on Ubuntu but not on Antergos?

I'm venturing beyond Ubuntu for the first time, and chose Antergos to ease my way into wider world of Linux. Everything's going pretty smoothly and pacman is becoming familiar, but autossh seems to be ...
Thomas Browne's user avatar
3 votes
3 answers
8k views

Autossh at boot with systemd

I am trying to start a persistent ssh connection at boot with autossh in systemd, following guides such as this one. When I do so, it connects and then immediately disconnects, with very little ...
fifthace's user avatar
  • 133
2 votes
0 answers
954 views

SSH Remote Port Forward Host Passwordless

I have a Remote Port Forward SSH tunnel from the host1 the host0 at port 10022 through: $ autossh -R 10022:localhost:22 host0 With host0 record in the ~/.ssh/config file both at host1 and host0: # ...
Brethlosze's user avatar
4 votes
2 answers
3k views

How do I use autossh to set up a no-frills socks proxy?

I use ssh -D 12345 [email protected] to set up dynamic port forwarding via host somewhere.com. I want to switch to using autossh to daemonize the thing and to make sure I don't need to manually ...
einpoklum's user avatar
  • 9,219