1827286 Members
1647 Online
109717 Solutions
New Discussion

Re: ssh to pc

 
SOLVED
Go to solution
jerry1
Super Advisor

ssh to pc

I am trying to use ssh scp to a pc but the "\"'s in the path are removed.

scp testfile user1@pc100:e:\Program*Files\files

Had to use an * for "Program Files".

Missing "\"'s from ssh "scp":

scp: e:Program*Filesfiles: No such file or directory


I have tried escape characters and other but
no go.

Is ssh scp only for UNIX or how do you pass
\ in a windows path?
19 REPLIES 19
HGN
Honored Contributor

Re: ssh to pc

Hi

Try and use Putty to connect to the unix server, there are different ways to connect on it Telnet SSH Rlogin Raw.

Hope this helps

Rgds

HGN
jerry1
Super Advisor

Re: ssh to pc

The subject is: ssh TO pc
James A. Donovan
Honored Contributor

Re: ssh to pc

You need an extra "\", and you can use the 8.3 abbreviation of "Progra~1" for "Program Files".

e.g.

scp myfile e:\\Progra~1\\files
Remember, wherever you go, there you are...
twang
Honored Contributor

Re: ssh to pc

did you try to use sftp, it should allow the following:
cd "Documents and Settings"
Steven E. Protter
Exalted Contributor
Solution

Re: ssh to pc

Hi Jerry,

What pc product you use may matter.

Please try:

changing
scp testfile user1@pc100:e:\Program*Files\files

to


scp testfile user1@pc100:e:\"Program Files\files"

Real space in Program files

The right command is somewhere withint the google search. Still pondering.

I'm seriously impaired due to some pain so I'll let you see my search.

http://www.google.com/search?hl=en&q=scp+to+pc+%22Program+Files%22&btnG=Google+Search


SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Gerhard Roets
Esteemed Contributor

Re: ssh to pc

Hi Jerry

scp testfile user1@pc100:e:\\Program\ files\\files

that should do it. SEP's way is off course less typing.

Just a note ... when i read your command line testfile implies 1 file ... but files implies multiples, are you trying to copy a set of file to a directory, or is files a archive of a group of files of some sort.

If its an archive or only 1 file your command is fine but if its a group of files
1.testfile should obviuosly be a directory
2. I would rewrite the command as follows ...

scp testfile user1@pc100:e:\\Program\ files\\files\\\*

That should do it

HTH
Regards
Gerhard
Gerhard Roets
Esteemed Contributor

Re: ssh to pc

HI Jerry

I forgot to add ... you do have a sshd running on that pc right?

If not here is 2 good links and follows the instructions to install ...

http://filezilla.sourceforge.net/

http://sshwindows.sourceforge.net/

HTH
Regards
Gerhard
jerry1
Super Advisor

Re: ssh to pc

What doesn't work:


Here it does not pass the "\"s.
scp testfile user1@pc100:e:\\Progra~1\\files
scp: e:Program~1files: No such file or directory

This is an invalid string in UNIX leaving me
at a continuation >.
scp testfile user1@pc100:e:\"Program Files\files"
>

Cannot escape the blank in Program Files.
scp testfile user1@pc100:e:\\Program\ files\\files
scp: ambiguous target

I have tried other variations. But I do not
understand why I cannot escape the \ with
\\. Which is valid in UNIX.

I will check out some of your docs but if
anyone can figure out how to use scp from
UNIX to PC. Let me know. If your syntax works
for you I would like to find out why.
John Palmer
Honored Contributor

Re: ssh to pc

Have you tried:

scp testfile "user1@pc1pp:e:\\\\Program Files\\\\files"

Regards,
John
jerry1
Super Advisor

Re: ssh to pc

Nope, it is still not passing the \.
And a wild card is still needed for
the blank of course.
Gerhard Roets
Esteemed Contributor

Re: ssh to pc

Hi Jerry

Just one very silly thing. You can ping the pc by that hostname from hpux ?

Regards
Gerhard

jerry1
Super Advisor

Re: ssh to pc

Gerhard, if sshd was not running on the pc,
I would not be able to connect. If I can
slogin and sftp in then ping'ing the system
doesn't tell me anything I don't already
know.

John, sftp may be an option but when you
sftp in you cannot get to the e: drive
unless there is some other way to cd to
e:\Program Files\files\

Steven, your link goes to a blank page.

This is real frustrating.


Paul Cross_1
Respected Contributor

Re: ssh to pc

Actually SEP's link works, just cut and paste it, don't click on it. Also, it would be helpful to know how you are running sshd on the windows side. this is important because it may affect the paths. Also, try using quotes around the entire destination. For example, I'm running sshd under cywin, in which case I would send files like this:

scp testfile "user@pc:/cygdrive/c/Program\ Files"

jerry1
Super Advisor

Re: ssh to pc

# $OpenBSD: sshd_config,v 1.65 2003/08/28 12:54:34 markus Exp $
jerry1
Super Advisor

Re: ssh to pc

Paul, your part :/cygdrive/c/ in
scp testfile "user@pc:/cygdrive/c/Program\ Files" eludes me.
What is /cygdrive/ and I assume /c/ is for c:
drive?


When I slogin. I am in:

C:\Program Files\OpenSSH> dir
Volume in drive C has no label.
Volume Serial Number is 38A7-E9C7

Directory of C:\Program Files\OpenSSH

11/23/2004 11:31a .
11/23/2004 11:31a ..
11/23/2004 11:37a .ssh
11/22/2004 11:06a bin
11/23/2004 11:14a docs
11/22/2004 11:46a etc
11/22/2004 11:06a tmp
11/22/2004 11:06a 85,619 uninstall.exe
11/22/2004 11:06a usr
11/22/2004 11:06a var
1 File(s) 85,619 bytes
9 Dir(s) 2,510,554,624 bytes free

I can change to e:\\\....


When I sftp I am in:

sftp> dir
.
..
.ssh
bin
docs
etc
tmp
uninstall.exe
usr
var


If I scp:

scp file1 :e:Program*Files

It puts file1 in the folder
Program Files on drive e:
But not in subdirectories that require a
\ in the path. \ does not get passed with
scp.


If I was to use sftp then how do I tell
it to put the file in e:\\
if I can't get to it.

I am not a windows person. I am a UNIX
thinker.




Ermin Borovac
Honored Contributor

Re: ssh to pc

/cygdrive/e is the same as e:

Please use '/' character and sshd on your pc will translate it to '\'.

So the following should work

scp testfile user1@pc100:'/cygdrive/e/program\ files/files'

'\' in 'program\ files' is used to escape space character.
jerry1
Super Advisor

Re: ssh to pc

It works!

Many, Many Thanks Ermin.

Paul Cross_1
Respected Contributor

Re: ssh to pc

I guess ermin answered that for me.

It's not ssh that is translating the slashes to backslases, it's because sshd is running under the cygwin environment. If you were to open a cmd session, you wont see c:\cygdrive.
jerry1
Super Advisor

Re: ssh to pc

Sorry Paul. Thank you also.
As to the PC cmd. I do not have access to
this system physically. It is a remote
server and my task is to only get scp
working to it for the oracle folks.

Now I have to figure out how to use
the ssh keys but others here have giving
me links for ssh that I have been reading that should help.

Thanks to all.