LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 01-28-2005, 08:29 PM   #1
Baix
Member
 
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203

Rep: Reputation: 30
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 08:30 PM.
 
Old 01-28-2005, 08:58 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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
 
Old 01-28-2005, 09:00 PM   #3
Baix
Member
 
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203

Original Poster
Rep: Reputation: 30
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
 
Old 01-28-2005, 09:04 PM   #4
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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 09:05 PM.
 
Old 01-28-2005, 09:15 PM   #5
Baix
Member
 
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203

Original Poster
Rep: Reputation: 30
lol we should have tried that in the first place. Yes he can ssh right on in.
 
Old 01-28-2005, 09:20 PM   #6
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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...
 
Old 01-28-2005, 09:25 PM   #7
Baix
Member
 
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203

Original Poster
Rep: Reputation: 30
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.
 
Old 01-28-2005, 09:33 PM   #8
Baix
Member
 
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203

Original Poster
Rep: Reputation: 30
Even wierder... he just sftp'd in and fetched a file.
 
Old 01-28-2005, 09:33 PM   #9
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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
 
Old 01-28-2005, 09:40 PM   #10
Baix
Member
 
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203

Original Poster
Rep: Reputation: 30
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 09:47 PM.
 
Old 01-28-2005, 09:46 PM   #11
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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 09:50 PM.
 
Old 01-28-2005, 09:49 PM   #12
Baix
Member
 
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203

Original Poster
Rep: Reputation: 30
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 09:54 PM.
 
Old 01-28-2005, 09:53 PM   #13
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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.
 
Old 01-28-2005, 10:12 PM   #14
Baix
Member
 
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203

Original Poster
Rep: Reputation: 30
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.
 
Old 01-28-2005, 10:18 PM   #15
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
scp text file busy error seran Linux - General 4 08-12-2021 03:36 PM
scp does not work and gives the following error message: scp: FATAL: Executing ssh1 i akay Linux - Networking 16 09-28-2008 11:41 PM
SCP Copy File SSH petenyce Linux - Wireless Networking 2 10-05-2005 03:11 PM
scp - peserve file ownership and permission eyt Linux - Newbie 6 10-24-2003 03:41 PM
SCP ??? where did the file go ?????? lub0 Linux - Security 3 10-07-2003 05:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration