Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This question already has an answer here:

Machine A is connected to the internet and is behind firewall so it cannot receive incoming connections. Machine B is open to the internet.

I want to be able to type commands into B and have them execute on A. Except it is A that has to reach out to B to establish the connection before B can send it commands.

Can this be done running SSHd on A and plain SSH client on B or do I need a combination of SSHd and SSH client on A (client to establish reverse tunnel pointing to SSHd).

share|improve this question

marked as duplicate by slm, jasonwryan, rahmu, Patrick, Anthon Nov 4 '13 at 2:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Please search the site before asking. This topic has been covered many times here: unix.stackexchange.com/questions/46235/…. If there is something specific missing from these Q's then highlight it either on those Q's or point it out in a new Q, referencing the previous ones. –  slm Nov 3 '13 at 22:36
add comment

1 Answer 1

If machine A can not be contacted "from the web" then it has to establish the conenction and open a tunnel. Then Machine B can contact Machine A over the tunnel.

http://www.linuxjournal.com/content/ssh-tunneling-poor-techies-vpn see the seciton on reversing the tunnel.

share|improve this answer
    
There's a typo in your answer: "seciton ". –  A.L Jan 14 at 13:34
add comment

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