29

I was given login credentials to a server and there is an @ character in my username. How can I make an SSH connection in my terminal?

username: [email protected]
host: domain.com

I've tried

$ ssh "[email protected]"@domain.com
$ ssh [email protected] -l domain.com

Nothing is seeming to work.

Any help?

1
  • Depending what OS you're using you can just connect in to the domain and enter a username once you join. Not optimal but still a solution.
    – Jon
    May 21, 2014 at 0:00

4 Answers 4

25

If the username is [email protected] you can try this:

$ ssh '[email protected]'@domain.com 
1
  • 2
    The quotes only escape the path from the shell. In this instance, as far as ssh is concerned it would be identical to ssh [email protected]@domain.com Jan 13, 2021 at 14:02
11

I just created a new user on my system called foo@domain and I could ssh into it perfectly well with just

ssh foo@domain@server

If for whatever reason that does not work for you, you can also do

ssh 'foo@domain'@badabing

or

ssh 'foo\@domain'@badabing
1
  • 2
    The quotes only escape the path from the shell. In this instance, as far as ssh is concerned, either suggestion would be identical to ssh [email protected]@badabing Jan 13, 2021 at 14:03
3

Whoever gave you the login credentials may have made a mistake. Have you tried just: ssh [email protected]?

3
  • I've voted you up, and I'm going to leave it, but there are instances where this is possible, and the first @ can be replaced with a +.
    – user3463
    Oct 26, 2012 at 20:25
  • Wow. I never knew that '@' was a valid username character... but then I never tried to use a username with an '@' in it.
    – BenjiWiebe
    Oct 26, 2012 at 20:27
  • 1
    It depends on the environment. I've seen with some virtual hosts this set-up. It's not pretty.
    – user3463
    Oct 26, 2012 at 20:30
2

I think that your username is foo so you should try: ssh [email protected] that will prompt you for the password.

You must log in to answer this question.

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