1

I'm trying to connect to a remote server through SSH, but I want to make an alias of the server name, and connect using a username different from my default one

Basically, I must enter the command :

ssh remoteUsername@host

But I want to access it using

ssh customHostname

I appended this to my ~/.ssh/.config file, but it doesn't work :

Host customHostname
  HostName host
  User remoteUsername
  IdentityFile ~/.ssh/id_rsa

I've checked that the usernames are the same, and i tried rebooting the PC, but it still doesn't work

Any ideas why ?

1 Answer 1

2

The content looks fine so far but the config file usually is ~/.ssh/config as described here.

1
  • 1
    General FYI: it's better to link to the actual man page, as there's no efficient means to verify the third-party site redundant explanations are current and up-to-date. OpenSSH ssh_config manpage
    – JW0914
    Commented Jun 13, 2022 at 14:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .