Jump to content
AvidPontoon

Auto ssh Headache

Recommended Posts

Hello

I am using autoshh on the lan turtle and have setup the config to connect to my lan turtle on port 8888 then I generated a key and copied it to my VPS. This all worked and I was able to connect upon starting autossh in that same session, but after I rebooted the lan turtle I cannot get a ssh session with it. It will give me either "connection reset by peer" and then "connection refused" or just straight up connection refusal. 

 

What am I doing wrong? This has been driving me insane. There is no firewall on the vps blocking the outbound connection either.

Share this post


Link to post
Share on other sites
16 hours ago, AvidPontoon said:

Hello

I am using autoshh on the lan turtle and have setup the config to connect to my lan turtle on port 8888 then I generated a key and copied it to my VPS. This all worked and I was able to connect upon starting autossh in that same session, but after I rebooted the lan turtle I cannot get a ssh session with it. It will give me either "connection reset by peer" and then "connection refused" or just straight up connection refusal. 

 

What am I doing wrong? This has been driving me insane. There is no firewall on the vps blocking the outbound connection either.

Did you seg autossh to autostart? That's not on by default, but can be configured in the same menu where you stared it. The option is marked as "enable". 

Share this post


Link to post
Share on other sites
10 hours ago, Sebkinne said:

Did you seg autossh to autostart? That's not on by default, but can be configured in the same menu where you stared it. The option is marked as "enable". 

Yes it is enabled on the menu I'm still stuck with connection refused tho :/

Share this post


Link to post
Share on other sites

This happened to me too.  With great frustration I wasn't able to SSH in, I even completely disabled the firewall for a little while but that didn't work.  In the end I realised that I needed to wait more than 30 seconds for the Turtle to boot.  For whatever reason, mine was being a little slow.  So maybe try plugging in the turtle, and then wait 10 minutes.  Once I did that, the Turtle has been working fine (and booting up after 30 -40 seconds as usual).

 

Share this post


Link to post
Share on other sites
6 hours ago, Rurn said:

This happened to me too.  With great frustration I wasn't able to SSH in, I even completely disabled the firewall for a little while but that didn't work.  In the end I realised that I needed to wait more than 30 seconds for the Turtle to boot.  For whatever reason, mine was being a little slow.  So maybe try plugging in the turtle, and then wait 10 minutes.  Once I did that, the Turtle has been working fine (and booting up after 30 -40 seconds as usual).

 

I'm having the same problem and it still won't allow a connection even after waiting a long time. For whatever reason, if autossh was started when I unplug turtle the next time I plug it in I can't connect. If I stop the autossh service before unplugging it works fine when plugged in next time. Thought? Ideas?

Share this post


Link to post
Share on other sites
51 minutes ago, Magneto417x said:

I'm having the same problem and it still won't allow a connection even after waiting a long time. For whatever reason, if autossh was started when I unplug turtle the next time I plug it in I can't connect. If I stop the autossh service before unplugging it works fine when plugged in next time. Thought? Ideas?

Whats your setup?

Share this post


Link to post
Share on other sites

Lan Turtle with Ubuntu 16.10 in cloud. I have root access. Like I said it works if you shutdown autossh and then unplug and plug back in.  What else do you need to know about setup?

 

Lan Turtle is default just like Darren does in video. 

Remote Port 2222

port 22

Edited by Magneto417x

Share this post


Link to post
Share on other sites

I'm experiencing the same problem. Even if enabled, LANTurtle wont connect automatically.

 

Starting from the turtle menu works fine though.

Share this post


Link to post
Share on other sites

I have this problem and for some reason, autossh adds an apostrophe ( ' ) to the end of the port variable after the turtle is turned off. I have no idea how to fix this but it seems to be the problem.

To fix it you have to remove the comma from the autossh config after every startup. Hopefully, they fix this soon.

 

Share this post


Link to post
Share on other sites

AutoSSH doesn't work for me once I've unplugged it from my USB port on my local machine. Any way to modify the single quote mark out of the config for AutoSSH?

Share this post


Link to post
Share on other sites
On 12/19/2018 at 7:07 PM, mule said:

AutoSSH doesn't work for me once I've unplugged it from my USB port on my local machine. Any way to modify the single quote mark out of the config for AutoSSH?

Even though the single tick appears in the field, if you backspace over it and save, you can get AutoSSH to run.  The backtick will appear again when you look at the config, but AutoSSH will work, regardless.

Share this post


Link to post
Share on other sites

I'm having trouble getting the LANturtle to connect with ssh, I can get the key to set and I can ping from the turtle to the Cloud IP address but I can not connect to the turtle from my Cloud IP address. I did notice that in the video explaining how to set it up there were only 3 options in set up after the keys are set and I have options host, port, port and port. Does anyone have an idea on what to do?

 

Share this post


Link to post
Share on other sites

Remember that you can exit out of the turtle menu to a command prompt.  Then cd /etc/turtle/autostart_modules.   Cat the 99-autossh module and check out the commands that are running.  Copy/paste them into the command line to try them yourself.  You'll likely see what the error is and then "Oh dang!", and fix it that way...

You can also do a "ps" from the command line, and see the services/commands that are running, that might give you a hint as well. 

Also check your disk space with "df -h", see how much space rootfs has "Available".  If it's critically low, things won't work right.  You can do a "du -sh /*" to see which folders at the root level are full.  cd into that folder, run it again, etc...til you find the culprit.

 

 

Share this post


Link to post
Share on other sites

In my current testing, I've had some of the same issues with autossh.  The biggest problem I have found, is that once you get the initial connection, the ports stay open on the receiving linux host (not the turtle).  So, when turtle tries to create the connection back on 2222, it's already in use, and it dies a horrid death.

My fix, is to edit your /etc/ssh/sshd_config options on your receiving host, to alter the keepalives.  If not, those ports will stay open for an arbitrary amount of time and drive you to drink...more...  Here's my settings:

    vi /etc/ssh/sshd_config
         TCPKeepAlive yes
         ClientAliveInterval 15 (checks every 15 seconds, if ssh conn is dead, kills it)
         ClientAliveCountMax 3 (just check 3 times)
 
You have to enable the KeepAlives, then have it check (mine every 15 seconds).  If there's no connection on the ports, it will close out those ports.  The next turtle insertion will work fine.  
I beat my head on this for a couple of hours, and checked the /var/log/auth.log and found these:
 
Apr 24 07:38:34 callhome sshd[7408]: error: bind [127.0.0.1]:20000: Address already in use
Apr 24 07:38:34 callhome sshd[7408]: error: channel_setup_fwd_listener_tcpip: cannot listen to port: 20000
Apr 24 07:38:34 callhome sshd[7408]: error: bind [127.0.0.1]:2222: Address already in use
Apr 24 07:38:34 callhome sshd[7408]: error: channel_setup_fwd_listener_tcpip: cannot listen to port: 2222
 
Happy hunting!
 
 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...