denningsrogue Posted November 21, 2015 Share Posted November 21, 2015 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. Quote Link to comment Share on other sites More sharing options...
denningsrogue Posted November 21, 2015 Author Share Posted November 21, 2015 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. Quote Link to comment Share on other sites More sharing options...
denningsrogue Posted November 22, 2015 Author Share Posted November 22, 2015 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. Quote Link to comment Share on other sites More sharing options...
V3RT!90 Posted November 23, 2015 Share Posted November 23, 2015 Did you follow this tutorial? https://forums.hak5.org/index.php?/topic/36292-video-104-persistent-shell-access-with-autossh/page-2#entry266333 Quote Link to comment Share on other sites More sharing options...
denningsrogue Posted November 23, 2015 Author Share Posted November 23, 2015 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. Quote Link to comment Share on other sites More sharing options...
V3RT!90 Posted November 24, 2015 Share Posted November 24, 2015 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. Quote Link to comment Share on other sites More sharing options...
denningsrogue Posted November 24, 2015 Author Share Posted November 24, 2015 I've tried that. What seems to work is to remove the user linked to the Turtle and recreate it but that means copying the keys to the VPS. Quote Link to comment Share on other sites More sharing options...
denningsrogue Posted November 28, 2015 Author Share Posted November 28, 2015 Anyone have any other suggestions. Without the autossh, a LanTurtle isn't much use. Quote Link to comment Share on other sites More sharing options...
aufsaufbremse Posted December 7, 2015 Share Posted December 7, 2015 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 ;-) Quote Link to comment Share on other sites More sharing options...
denningsrogue Posted December 20, 2015 Author Share Posted December 20, 2015 I think I have found a work around. Instead of logging in as "ssh root@localhost -p 2222" try this first: "ssh turtle@localhost -p 2222". The login will fail but then when you login with "ssh root@localhost -p 2222" it will work. Quote Link to comment Share on other sites More sharing options...
WSiaB Posted December 24, 2015 Share Posted December 24, 2015 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? Quote Link to comment Share on other sites More sharing options...
telot Posted December 28, 2015 Share Posted December 28, 2015 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 1 Quote Link to comment Share on other sites More sharing options...
WSiaB Posted December 29, 2015 Share Posted December 29, 2015 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)? Quote Link to comment Share on other sites More sharing options...
WSiaB Posted December 29, 2015 Share Posted December 29, 2015 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. Quote Link to comment Share on other sites More sharing options...
telot Posted December 29, 2015 Share Posted December 29, 2015 Anytime WSiaB! Glad you got it working! telot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.