I have a server which has only access to the outer world via port 22 (for the use of ssh from the server to other computers).

I want to install some packages via apt-get on this server.

Can I achive this with a ssh-tunnel to my super-machine which has internet access on all ports?

If so, how? Because if I start a tunnel via ssh to my super-machine, the super-machine has its sshd waiting on port 22. I assume that I cannot reuse this same port 22 for the tunneling, can I?

Is there another solution?

share|improve this question

Try to run it via ssh socks proxy:

echo 'Acquire::socks::proxy "socks://localhost:3128/";' | sudo tee -a /etc/apt/apt.conf
ssh -CND localhost:3128 user@remote.host

in another terminal session:

sudo apt-get whatever you need
share|improve this answer
    
Why the compression? And how do you end the SSH if it's not running a shell to ctrl+d? – erikbwork Sep 17 '15 at 15:32
1  
compression helps on slow channels. though it's not necessary here. I use ctrl+c to close the connection. – rush Sep 17 '15 at 17:02

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.