How to connect to SSH with '@' character in username

15

3

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: foo@domain.com
host: domain.com

I've tried

$ ssh "foo@domain.com"@domain.com
$ ssh foo@domain.com -l domain.com

Nothing is seeming to work.

Any help?

macek

Posted 2012-10-26T20:15:46.517

Reputation: 5 157

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 – 2014-05-21T00:00:50.310

Answers

16

If the username is foo@domain.com you can try this:

$ ssh 'foo@domain.com'@domain.com 

Shoo Limberger

Posted 2012-10-26T20:15:46.517

Reputation: 171

5

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

Kitsos

Posted 2012-10-26T20:15:46.517

Reputation: 407

2

Whoever gave you the login credentials may have made a mistake. Have you tried just: ssh foo@domain.com?

BenjiWiebe

Posted 2012-10-26T20:15:46.517

Reputation: 7 672

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 +. – None – 2012-10-26T20:25:59.220

Wow. I never knew that '@' was a valid username character... but then I never tried to use a username with an '@' in it. – BenjiWiebe – 2012-10-26T20:27:45.770

1It depends on the environment. I've seen with some virtual hosts this set-up. It's not pretty. – None – 2012-10-26T20:30:14.267

2

I think that your username is foo so you should try: ssh foo@domain.com that will prompt you for the password.

nuxxxx

Posted 2012-10-26T20:15:46.517

Reputation: 21