Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
01-28-2005, 09:29 PM
|
#1
|
Member
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203
Rep:
|
SCP: No such file or directory...but its there!?
I'm trying to get a friend to scp a file to me, test.txt, we've been using the command (yes...foo'd=my ip address):
scp test.txt brian@foo'd:/home/brian
however he keeps getting the error:
cp: brian@foo'dhome/brian: No such file or directory
Yes...for some reason in the error the :/ between the ip and /home/brian is not there. And I double checked...brian does have an account, password and a /home directory on my computer.
Last edited by Baix; 01-28-2005 at 09:30 PM.
|
|
|
01-28-2005, 09:58 PM
|
#2
|
Senior Member
Registered: Jan 2003
Posts: 2,786
|
Does the server actually have an apostrophe ( ' ) in the name, or is that just an example? If it does, that's probably part of the problem. The shell is probably interpreting that as the beginning of a string. Try escaping it:
Code:
scp test.txt brian@foo\\'d:/home/brian
|
|
|
01-28-2005, 10:00 PM
|
#3
|
Member
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203
Original Poster
Rep:
|
no sorry, foo'd is just what i changed my ip address to show, and there's no apostrophe in the ip address. I'd rather not have people bashing on my door trying to log in as brian lol
|
|
|
01-28-2005, 10:04 PM
|
#4
|
Senior Member
Registered: Jan 2003
Posts: 2,786
|
Your friend can ssh into the box using the brian account, right?
I mean:
Code:
ssh brian@ip_address
and he gets a shell to mess around with.
Last edited by Dark_Helmet; 01-28-2005 at 10:05 PM.
|
|
|
01-28-2005, 10:15 PM
|
#5
|
Member
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203
Original Poster
Rep:
|
lol we should have tried that in the first place. Yes he can ssh right on in.
|
|
|
01-28-2005, 10:20 PM
|
#6
|
Senior Member
Registered: Jan 2003
Posts: 2,786
|
Well, I don't understand what would be the problem. I'll ask this though:
Quote:
cp: brian@foo'dhome/brian: No such file or directory
|
I'm hoping the "cp" is a typo and it's actually scp  If your friend is using cp, then you need to bludgeon him about the face and neck.
If you can ssh in, then there should be no problem with scp... I'm at a complete loss...
|
|
|
01-28-2005, 10:25 PM
|
#7
|
Member
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203
Original Poster
Rep:
|
Actually cp isn't a typo, the error actually comes out like that.
And I made quadrubly sure he was trying scp before preparing to bludgeon him to a bloody pulp. 
|
|
|
01-28-2005, 10:33 PM
|
#8
|
Member
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203
Original Poster
Rep:
|
Even wierder... he just sftp'd in and fetched a file.
|
|
|
01-28-2005, 10:33 PM
|
#9
|
Senior Member
Registered: Jan 2003
Posts: 2,786
|
That's odd, because I went to go try it myself. Here's what I got:
Code:
$ scp test.txt helmet@spaceball1:/home/helmet/no_exist/test.txt
helmet@spaceball1's password:
scp: /home/helmet/no_exist/test.txt: No such file or directory
Very odd indeed, because if my version were acting like yours, then I would have expected to see:
Code:
scp: helmet@spaceball1home/helmet/no_exist/test.txt: No such file or directory
That suggests there's something kinda funky going on... maybe scp is not interpreting the destination path correctly. Are there any special characters being used on the command line, like double quotes, or the like? Something that might cause confusion?
And for the record, my version of scp:
Code:
$ ssh -V
OpenSSH_3.9p1, OpenSSL 0.9.7e 25 Oct 2004
|
|
|
01-28-2005, 10:40 PM
|
#10
|
Member
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203
Original Poster
Rep:
|
i noticed you also had to type in a password, he doesn't even get to do that.
Also I tried to do exactly what i told him to do, even used his name and password and it worked:
Code:
bash-3.00$ touch test.txt
bash-3.00$ scp test.txt brian@foo'd:/home/brian
brian@foo'd's password:
test.txt 100% 0 0.0KB/s 00:00
and same version:
Code:
bash-3.00# ssh -V
OpenSSH_3.9p1, OpenSSL 0.9.7e 25 Oct 2004
Oh lol, he just reminded me...is now a bad time to mention that he's on a mac using its unix /bin/bash. Not sure if it matters though, seeing as he's able to ssh and sftp. His ssh -V says:
OpenSSH_3.6.1p1+CAN-2004-0175, SSH protocols 1.5/2.0, OpenSSL 0x0090702f
Last edited by Baix; 01-28-2005 at 10:47 PM.
|
|
|
01-28-2005, 10:46 PM
|
#11
|
Senior Member
Registered: Jan 2003
Posts: 2,786
|
At this point, I think it's pretty clear there's something fubar'ed with his client. I don't know if he's using a linux box with a strange/old version of the ssh suite, or if he's using a windows client that needs some reconfiguring, but there's something wrong on his side.
I'll look the other way if you want to start bludgeoning at this point.
EDIT: That could be the problem. Mac ports (I have heard) are not always 100% faithful reproductions of their original unix counterparts. I would check the man page for his scp documentation. He may need to break up his command. For instance, he may need to do something like:
Code:
scp -u brian -ra foo'd test.txt /home/brian
Again, just an example, it will probably be different. In other words, specifying the user name with a command line option, the server to connect to, etc.
Unfortunately, I don't have any first-hand experience with a Mac, and can't give anything more than that...
Last edited by Dark_Helmet; 01-28-2005 at 10:50 PM.
|
|
|
01-28-2005, 10:49 PM
|
#12
|
Member
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203
Original Poster
Rep:
|
Looks like you caught it before me, just edited my last post when he reminded me about that. And not to be redundent but his ssh -V is:
Code:
OpenSSH_3.6.1p1+CAN-2004-0175, SSH protocols 1.5/2.0, OpenSSL 0x0090702f
and if he can ssh and sftp why won't scp work as well? Anyway, thanks a lot for your time and help.
EDIT: Oh just saw your other edit about the mac ports, we'll try that and check his man pages.
Last edited by Baix; 01-28-2005 at 10:54 PM.
|
|
|
01-28-2005, 10:53 PM
|
#13
|
Senior Member
Registered: Jan 2003
Posts: 2,786
|
Yeah, if he can ssh, then his version should be capable of handling the protocols to copy the file. Even doubly so if he can sftp (because an scp should be a trivial ftp connection). My guess is the command line syntax. I figure there's got to be something unique/different in the way he would have to specify the user name, server, and that sort of thing.
|
|
|
01-28-2005, 11:12 PM
|
#14
|
Member
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203
Original Poster
Rep:
|
I'm getting a headache look at this mess lol:
Here's he's usage for scd:
Code:
usage: scp [-pqrvBC1246] [-F config] [-S program] [-P port]
[-c cipher] [-i identity] [-l limit] [-o option]
[[user@]host1:]file1 [...] [[user@]host2:]file2
And here's my usage for scd:
Code:
usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 [...] [[user@]host2:]file2
There are minor difference, working on trying to figure out how exactly the command should chnage.
|
|
|
01-28-2005, 11:18 PM
|
#15
|
Senior Member
Registered: Jan 2003
Posts: 2,786
|
Well, it looks pretty much the same... I was mainly suspicious of the user@host parts.
In that case, the problem might be with bash and how it interprets the command line. He could try quoting the destination file in an attempt to preserve it. Something like:
Code:
scp test.txt 'brian@ip_address:/home/brian'
I didn't use the foo'd bit just to avoid confusion about the quoting. If that works, then his version of bash is interpreting the user@host:file specification as something "special".
|
|
|
All times are GMT -5. The time now is 01:37 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|