Jump to content

Auto ssh -- connection refused


denningsrogue
 Share

Recommended Posts

Guys

I had auto ssh set up and working reliably using an Ubuntu 14.04 server on digital ocean. Then it stopped working and I got the connection refused message. Set the whole thing up again using a new Ubuntu server on digital ocean and same thing -- worked then stopped. Figured I'd try freeBSD. Same thing. Worked for a while then stopped with a connection refused message. I reinstalled the operating system but now no matter what I do I get the connection refused error. It's strange. SSHFS continues to work, but unless I connect the turtle to my USB port, I can't get in. Any suggestions would be greatly appreciated.

Link to comment
Share on other sites

I think I resolved the problem. It was a permissions issue. When setting up the sshfs from my home computer to my VPS, I changed the permissions of the home folder that the lan turtle was writing to so that the Lan turtle and my home computer could read from and write to the same folder on the VPS. In that process, I changed the permissions of the home folder of the turtle user which included the hidden .ssh folder and that busted things.

Link to comment
Share on other sites

So the problem isn't resolved. I got the Lan Turtle stuck when i typed "if config" rather then "ifconfig" to get its IP address. I pulled the power and thereafter the "connection refused" message again.

My guess is the that the sudden disappearance of the one end of the tunnel leaves the VPS or the Turtle in a broken state but I don't know how to fix it. I rebooted both the Turtle and the VPS to no effect. I disabled and reenabled autossh on the Turtle also to no effect.

I am using a FreeBSD VPS but the expect the problem was the same for the Ubuntu VPS. Somehow after the power loss, the ssh tunnel isn't being properly established.

If a guru here could offer a suggestion, I would appreciate it.

Link to comment
Share on other sites

I did. I set up autossh with the Turtle attached to my computer's USB port. Confirm that I can connect to the Turtle using my VPS over the LAN. Unplug the Turtle and plug it into a separate power source and I get the connection refused message. I delete the entry for known_hosts on the VPS and sometimes I will then be able to connect but if it is powered down again no way to bring ssh tunnel back to life. I've tried it with 3 different VPSs (Ubuntu, Debian and FreeBSD). Same on all of them. Works briefly but once the Turtle is powered down, I get the connection refused message. Deleting known_hosts may fix it, but only once.

Essentially this renders the Turtle unable to be deployed.

Link to comment
Share on other sites

  • 2 weeks later...

I also get connection refused when i reboot my system sometimes.

Then i ssh in the vps and type reboot [enter] and im able to connect again.

Same problem here. After restarting autossh on turtle connection from vps ist possible, but in the wild I´m not able to restart autossh on turle ;-)

Link to comment
Share on other sites

  • 2 weeks later...

Any updates? I am having the same problem.

After SSHing into the VPS I enter:

asdf@asdf:~$ ssh root@localhost -p 2222
ssh: connect to host localhost port 2222: Connection refused

I use a non-standard port for SSH on my VPS, could this be the cause?

Link to comment
Share on other sites

WSiaB - yes thats exactly the cause. Setup the turtle gui like you normally would. Then exit the gui back to the command line and edit /etc/config/autossh and include -p yoursshport in the command.

telot

  • Upvote 1
Link to comment
Share on other sites

Thanks telot - here is what I have on the LAN Turtle /etc/config/autossh file:

config autossh
    option gametime '0'
    option monitorport '20000'
    option poll '600'
    option ssh '-i /root/.ssh/id_rsa -N -T -R 2222:localhost:22 turtle@my_vps_ip -p 2222'

I see the mapping (222:localhost:22), but it doesn't seem to be working on the VPS for some reason. What is the monitorport (tried changing with no luck)?

Link to comment
Share on other sites

telot - disregard the previous message, I'm an idiot. Changed the -p part to my non-standard port and it works like a charm now! I am going to try dropping it on a few networks and see how it works, but so far so good. Thanks for helping with this.

Link to comment
Share on other sites

Anytime WSiaB! Glad you got it working!

telot

Link to comment
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.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...