0

In order to access to my pc at work i do:

ssh -AY myusername@server_of_the_company

and then:

ssh -AY myusername_at_my_pc@ip_address_of_my_pc

I read about ssh tunnelling but i cannot make it work. Which command should I use to connect directly from local to my pc at work?

Bonus question, how to setup scp to copy back and forth from local to my_pc?

muru
  • 207,228
Pierpaolo
  • 161
  • 1
  • 1
  • 6

2 Answers2

3

You can do:

ssh -L 2222:ip_address_of_my_pc:22 -AY myusername@server_of_the_company

This will forward connections to port 2222 of localhost to port 22 of your PC.

Then, to connect to your PC, you can do (from your local system):

ssh -AY -p 2222 myusername_at_my_pc@localhost

scp works similarly.

muru
  • 207,228
0

In your .ssh/config file:

Host my_pc
  ProxyCommand ssh -a server_of_the_company -W %h:%p