1

So my university supplied access to a server with backslashes, like this:

ssh portoalegre\\15280433@university.server.br

and I decided to copy my public key there to be more secure (and not having to type the password every time). This works fine! However ... I then decided to set an entry in ~/.ssh/config so I could just login using

ssh university

But it didn't worked. It keeps asking me for my password. Here is the entry I setup on the config file:

Host university
  Hostname university.server.br
  User portoalegre\\15280433

What am I doing wrong? How should I escape/handle those 2 backslashes in the config file? I'm using a Ubuntu Desktop machine to connect to the server via its default terminal.

1 Answer 1

6

The \\ in your SSH command really represent a single \ (try echo portoalegre\\15280433@university.server.br and see what that displays). So the first thing to try is to use a single backslash in your SSH config:

Host university
  Hostname university.server.br
  User portoalegre\15280433
2
  • Awesome! That worked. The instructions supplied said in unix/linux we needed to use 2 backslashes, and 1 in windows/putty. Did not tried with a single backslash. Thanks man!
    – Vini.g.fer
    Sep 29, 2018 at 13:42
  • 2 backslahes in the command line, one backslash escaping the second, because bash uses backslashes for special purposes. But your id only has one and that's what the SSH config needs.
    – xenoid
    Sep 29, 2018 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.