LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   SSH Tunneling issues (https://www.linuxquestions.org/questions/linux-security-4/ssh-tunneling-issues-4175423218/)

druisgod 08-21-2012 07:58 AM

SSH Tunneling issues
 
I have an externally hosted website with bluehost.com and a simple network here at work.

The external website I have connects back through a reverse tunnel to my ldap server on my local network. I have a script that goes out very 10 minutes (via cron) and checks to make sure that the connection is up and if not, it restarts it. The issue is that the script that I wrote works once or twice and then sometimes not at all.

Bluehost will not let me run a ldap server. I could port forward through my firewall, but would rather tunnel to keep ports closed.

The question I have is if there is a simpler method of doing this that is as secure as a tunnel? The tunnel works fine if I run it by hand. It's flaky if run it by script.

sundialsvcs 08-21-2012 08:17 AM

OpenVPN comes to mind. I don't know if Bluehost supports it (don't know anything at all about them), but maybe a few phone-calls will answer some questions there, or open some doors. My general feeling is that this technology is the one more commonly used for (commercial grade) cryptographically secured tunneling.

Quantumstate 08-23-2012 10:08 AM

Reverse tunnelling is wonderful, isn't it. Very few understand it but it is so useful.

I'm running reverse tunnels as well, and haven't been able to make them come up with NetworkMangler. Should run from the /etc/network/if-up.d dir, but I always have to run the script by hand, even though I have a wait 10. I suspect it has to do with slow association of wifi.

Once mine's run it generally stays up until I put the machine asleep. I have it set up for the 'sleeper' user, as per directions I found once out there. Here's one of my entries:
/usr/bin/ssh -v -f -l sleeper -i /home/sleeper/.ssh/id_ecdsa -2 -4 -c aes256-ctr,aes128-ctr -L 6543:localhost:6543 droog sleep 365d

Search on sleeper and reverse tunnel and you should find what you need.

How about sharing your cron file?

Reuti 08-24-2012 09:22 AM

There is autossh.


All times are GMT -5. The time now is 06:45 AM.