Avatar of lmbotg
lmbotg
 asked on

SCP/SFTP login name issues

I have been provided a login name of xxx.xxx@xxxxx.com to access a remote sftp site. The problem is that the scp/sftp command line utilities do not see anything before the "@" in the login name. For example:

scp xxx.xxx@xxx.com@ftp.xxxx.net:~/test.txt .
xxx.com@ftp.xxx.net's password:

As you can see, the front part of the login name is NOT passed to the remote host. I have already tried to escape the "@" with a "\"  with no luck. One last piece of info is that I CAN ssh using ssh ftp.xxx.net -l xxx.xxx@xxx.com, and this works nicely....

Any help is appreciated.
Linux Networking

Avatar of undefined
Last Comment
pjedmond

8/22/2022 - Mon
pablouruguay

i cant understad.

please replace the X for another example please the ftp X are the same of you domain?

put example1.com    example2.com
de2Zotjes

Did you protect the entire sequence from local expansion by enclosing it in single quotes?
pjedmond

Wow - this is a fun one:)...and is not standard between different versions of scp either.

For Cygwin, this works:

$ scp me@cb.ws'@192.168.0.100:/home/me\@cb.ws/test.txt' .
me@cb.ws@192.168.0.100's password:
test.txt                                      100%   18     0.0KB/s   00:00

Still working on linux and windows scp.exe


This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
lmbotg

ASKER
pjedmond,

It warms my heart to see that you are having so much fun with this one..... ;)

Cheers,

QWade
pjedmond

OK - it is possible on linux...but I've tried all sorts of wierd and wonderful char combinations, and I cannot solve the problem that you had with the @ directly......however......this works!!!!!!!!!!!1111:

[root@Girton root]# su me@cb.ws
[me@cb.ws@Girton root]$ cd ~
[me@cb.ws@Girton me@cb.ws]$ scp '192.168.0.100:/home/me\@cb.ws/test.txt' test2.txt
me@cb.ws@192.168.0.100's password:
test.txt             100% |**************************************|    18       00:00
[me@cb.ws@Girton me@cb.ws]$

Create a user called me@cb.ws (where me@cb.ws is your usernam). Become that user and then scp, WITHOUT giving the username. scp will take the curent username that you are. This works on RedHat 8.0

...and now to have a look at Windows scp.exe......or shall I go to bed?

What operating system are you trying to scp from? (If windows, you have a Cygwin solution above, or linux, this one works). If you find that you still have a problem post the exact version of linux/windows that you are using, and I'll try a few more ideas.
pjedmond

Ha ha ha ha - windows! - No problems at all!

C:\downloads>pscpx86.exe me@cb.ws@192.168.0.100:/home/me\@cb.ws/test.txt .
me@cb.ws@192.168.0.100's password:
test.txt                  |          0 kB |   0.0 kB/s | ETA: 00:00:00 | 100%

C:\downloads>


Yet again no security checking in Windows??? This pscpx86.exe is from the putty website:)
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
pjedmond

...or perhaps I ought to give the putty people some credit for thinking about this problem more clearly than the ssh people?????
lmbotg

ASKER
pjedmond,

You can go to bed..... I am attempting this little feat from a RH box, so your fake out via a username will work for me.

Cheers,

QWade
ASKER CERTIFIED SOLUTION
pjedmond

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
pjedmond

...which is obviously much neater than the creation of seperate account to login to your remote account.
The issue has been noted by the ssh team and may be considered as a future extension to the standard concerned.

I guess that this question can now be closed, as I've got nothing more that I can add:)
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
lmbotg

ASKER
pjedmond,

Thanks for helping out with this.... Next time, I will go to the source (ssh team) like you did.... who knew that they would be so responsive....

I have set the ~/.ssh/config file up, and it is working now....

Cheers,

QWade
lmbotg

ASKER
Admins,

Please close this question out and award pjedmond th 125 points and add another 100 for going above and beyond....

QWade
pjedmond

Ideally, you should not be approaching the team directly as many issues that get thrown at them are not real problems. This wastes significant amounts of their time and are often ignored. However, this was a particularly interesting situation with discrepancies that I thought was worth highlighting, as I know of a number of companies that provide usernames that consist of an @ sign.

To increase points, you have the option of doing this by changing the number at the bottom of this thread, and clicking submit.

As for closing this question, you can do this by clicking the 'Accept' button to the right of the answer that applies to you. (You may need to scroll your page to the right in order to see this.)


⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.