Debian autossh boot script not working properly
ssh exited with error status 255
usually points out authentication or connectivity issues. Try running your autossh
without -f
option so you can see its output:
autossh -M 0 -N -o \"ServerAliveInterval 60\" -o \"ServerAliveCountMax 3\" -R 11111:localhost:22222 -i /home/username/.ssh/id_rsa -p 3333 user@server_ip
Out of autossh
manual:
Note that there is a crucial a difference between
-f
with autossh, and-f
with ssh: when used withautossh
ssh will be unable to ask for passwords or passphrases.
You can also try passing -v
or -vv
options to ssh
to help your debug:
autossh -M 0 -N -vv -o \"ServerAliveInterval 60\" -o \"ServerAliveCountMax 3\" -R 11111:localhost:22222 -i /home/username/.ssh/id_rsa -p 3333 user@server_ip
Also, please note that /usr/lib/autossh/autossh
is the process that monitors your ssh
session, and restarts it if required. If your autossh
command it's working you should be able to see both autossh
and ssh
process:
$ps -eo user,pid,args | grep ssh
----------
someuser 16384 /usr/lib/autossh/autossh -M 33332 -N -R 11111:127.0.0.1:22222 serverip
someuser 16385 /usr/bin/ssh -L 33332:127.0.0.1:33332 -R 33332:127.0.0.1:33333 -N -R 11111:127.0.0.1:22222 serverip
And btw, you don't need to pass the -f
option to ssh
, autossh
will start it in background, by default.
Related videos on Youtube
![Harish](https://i.stack.imgur.com/rOtX1.jpg?s=256&g=1)
Harish
Developer actually using C# and SQLAnywhere but with long experience with Delphi.
Updated on September 18, 2022Comments
-
Harish almost 2 years
I started working on an iPhone application (XCode 5 and iOS 7). I am not sure why when I run my app, it's hiding my Navigation Bar's title and back button. Here are some screen shots.
If you look closely, something is hiding the title and back button. Not sure what?
-
bneely almost 11 yearsI would start by setting backgroundColor on some of the views to see if they are where you expect.
-
Harish almost 11 yearsLooks okay. I tried setting the content inset as well. Still the same
-
bneely almost 11 yearsAre you using a nib for your view controller? If not, how are you constructing the view?
-
Harish almost 11 yearsyes, I am using storyboards
-
bneely almost 11 yearsTry the visual view debugging options mentioned here: cocoanetics.com/2011/05/visual-view-debugging
-
wurtel over 9 yearsNote that the manpage states The -f flag is stripped from arguments passed to ssh.
-
vaindil over 9 years@wurtel I did see that, but it should still appear in the process list, shouldn't it? The process list shows the
autossh
command, not thessh
command. (Honest question, not saying you're wrong.) -
wurtel over 9 yearsIt's showing
/usr/lib/autossh/autossh
, not/usr/bin/autossh
. It doesn't pass the-f
option to this helper process. Have you checked syslog for messages fromautossh
? -
vaindil over 9 years@wurtel syslog is showing
ssh exited with error status 255; restarting ssh
for eachautossh
line, even though running the individual commands just asssh
works correctly. That error is returned whether the script is run or if I run the line from the script directly in bash.
-
-
Jakob Bennemann over 9 yearsThis does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post.
-
Anthon over 9 yearsI changed your "comment" to a potential answer, stating your questions as assumptions. Please flesh out the answer by providing the description of the known configuration issues, possible supported with some external links.
-
Jakob Bennemann over 9 years@Lambert It doesn't take long to build up the rep needed. In the future, restrain yourself from such posts until you do have the rep. That's the point.
-
Lambert over 9 years@HalosGhost, I get your point, but (just curious) why do you think my answer is not the right one? I tried to help the author with another possibility since issues on private/public keys are common.
-
Jakob Bennemann over 9 yearsNow that it has been rewritten as an answer, I don't mind it at all.