Solved

SCP/SFTP login name issues

Posted on 2004-08-20
13
621 Views
Last Modified: 2012-05-05
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.
0
Comment
Question by:lmbotg
13 Comments
 
LVL 14

Expert Comment

by:pablouruguay
Comment Utility
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
0
 
LVL 6

Expert Comment

by:de2Zotjes
Comment Utility
Did you protect the entire sequence from local expansion by enclosing it in single quotes?
0
 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
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


0
 

Author Comment

by:lmbotg
Comment Utility
pjedmond,

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

Cheers,

QWade
0
 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
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.
0
 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
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:)
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
...or perhaps I ought to give the putty people some credit for thinking about this problem more clearly than the ssh people?????
0
 

Author Comment

by:lmbotg
Comment Utility
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
0
 
LVL 22

Accepted Solution

by:
pjedmond earned 225 total points
Comment Utility
Response from the ssh team:

In a standard URL syntax, @ may be replaced by %40, I suppose that might
be an extension worth considering for sftp and/or scp... That is, you
would use this command:

  scp xxx.xxx%40xxx.com@ftp.xxxx.net:~/test.txt .

However, it may be easier for now to consider using $HOME/.ssh/config
to help you in this case:

                      ---------------
Host ftp.xxxx.net
    User xxx.xxx@xxx.com
                      ---------------

and the command would then be

    scp ftp.xxxx.net:~/test.txt .

which is typically much easier to type as well.

      Good luck,
      -- Mark
0
 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
...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:)
0
 

Author Comment

by:lmbotg
Comment Utility
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
0
 

Author Comment

by:lmbotg
Comment Utility
Admins,

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

QWade
0
 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
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.)


0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now