0

I am trying to set up my config file for ssh. When I work from home I connect to machine located remotely as follows

  1. Tunneling to the machine via local port ssh -N -l poppop -L 2223:my_machine:22 my.domain.com &

  2. Then logging to machine using ssh -p 2223 username@localhost

Please help me setting my config file so that I dont have to tunnel it every time to log in.

Thanks.

1
  • You have to tunnel, else you wouldn't be doing this. Do you mean that you want to automate the tunnelling step? How about putting these two lines into a script?
    – Paul
    Feb 8, 2013 at 3:59

1 Answer 1

0

you don't need config file. just run

 ssh-copy-id [-i [identity_file]] [user@]remote-machine

this command will copy your publicKey to remote, then you don't have to give password everytime.

if you don't have ssh-key pair yet, you need to generate a key-pair first.

man ssh-keygen for detail.