Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Using the .ssh configuration file to save host specific options (~/.ssh/config). Never again long ssh commands to connect to your frequently connecting list.

    Host home home.example.com
      HostName home.example.com
      Port 12345
      User dryicerx
      IdentityFile ~/.ssh/somekey.pem
      LocalForward 59001 localhost:5901 
      
    Host *amazonaws*
      User root
      IdentityFile ~/.ssh/yourawskey

now on your command line, and the settings will automatically be applied.

    ssh home  
    ssh 1-2-3-4.blah.amazonaws.something.com
     
I specially love the last one if you are working with EC2, as it catches any EC2 domain name and applies the key with the root user.


Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: