Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a home PC connected through twoway satellite modem. I cant reach from outside, so after a some research I found a solution which is reverse ssh tunneling. but I have a few question regarding the ssh

I have a server, and I would like to make a reverss connection, after I can Use a port-forwarding so I can connect to the HOME PC using the established reverse connection. My question is if I create a public key to establish a connection between the HOME PC and the server, afterwards is it possible to login to this server from a different PC using the password instead of public key?

I would like to write a script(cron job) which establishes the ssh connection, so after 30 minutes it will check if the connection is broken or not, if it's broken, than it will reestablish the connection, how can I check whether the ssh connection is still open?

share|improve this question

2 Answers

up vote 1 down vote accepted

SSH can be configured to accept both a public key and a password. I haven't disabled the lengthy and arduous password I set up on my SSH servers just in case I lose the keyfiles.

If you are using the ssh client to establish the connection, it exits when the connection is terminated. You can either store the PID of the ssh client when you launch it and check to see if that same PID is running, or call ssh from a script without exiting the script, and use while (assuming bash) to set up an infinite loop to call ssh over and over each time it terminates. init is explicitly designed for this so you might look into that as well.

share|improve this answer

Not answering your exact question, you'll solve the problem with products like neorouter... Real easy to setup and handles just about any firewall config.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.