ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Make Alternative Port and User SSH Simple with ssh_config

    IT Discussion
    ssh linux unix sshconfig
    3
    3
    997
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by

      Many of us, for one reason or another, have to log into servers via SSH using non-standard ports (other than 22) or a user that is not the same as the user on our local machine. This can be annoying, especially for scripting system access. But SSH has a simple fix for this, the ssh_config file.

      vi ~/.ssh/config
      

      This file is probably non-existent on your system if you have not used it before. So the vi command will create it now. Now for each host that we want to configure, we can just put in simple details like these:

      Host hostname
      Port 8022
      User altusername
      

      That's it. Now you don't have to specify a non-standard port for any server, just access it normally. Life is easy.

      1 Reply Last reply Reply Quote 3
      • stacksofplatesS
        stacksofplates
        last edited by

        Just to clarify for others, everyone has an /etc/ssh/ssh_config file. Not everyone has it under ~/.ssh/.

        1 Reply Last reply Reply Quote 1
        • travisdh1T
          travisdh1
          last edited by

          I see new, greater, horizons of automation happening here.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post