Operating System - HP-UX
1753475 Members
4670 Online
108794 Solutions
New Discussion юеВ

Re: how to scp from HP unix 11.31 via both way to MS-windows

 
James_Lau
Frequent Advisor

how to scp from HP unix 11.31 via both way to MS-windows

Hi all , can any one guide me ,how to go about using scp with script fire from HP unix 11.31 get file from a MS-windows directory ?
8 REPLIES 8
Taifur
Respected Contributor

Re: how to scp from HP unix 11.31 via both way to MS-windows

Hi James,

Scp - secure copy between hosts. See more info and examples

http://acs.ucsd.edu/info/scp.shtml

It stands for secure copy

# scp -p file hostb:/destination
#scp -p file remotehost or ip:/destination
You then see it copy and the % complete

If it helps, pls assign point.

Rgds,
Taifur
Suraj K Sankari
Honored Contributor

Re: how to scp from HP unix 11.31 via both way to MS-windows

Hi,

You cant scp or ftp any directory before you need to zip it and copy. Or else you need to 1st go to that destination directory and mget or mput the all file, best practices for mget or mput is start ftp with -i option that is interactive mode ex:
ftp -i servername

Suraj
Court Campbell
Honored Contributor

Re: how to scp from HP unix 11.31 via both way to MS-windows

Suraj,

You can scp a directory. just use the -r option. Anyway. You need to have an sshd service running on the windows server. There is an openssh port for windows that works well. Once installed you can scp from hpux to windows and vice versa. But it won't work until the service is on the windows box.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
mobidyc
Trusted Contributor

Re: how to scp from HP unix 11.31 via both way to MS-windows

Hello,

what do you want to do:
- copy a Unix directory from a windows ?
or
- copy a Windows directory from Unix ?

from the windows size you can:
- use cygwin for the 'scp' command
- use the brilliant 'winscp' freeware

from the Unix size you need to have an ssh server.

for scripting with ssh, the best is to use a passwordless connection using a publickey.

Regards,
Cedrick Gaillard.
Best regards, Cedrick Gaillard
Court Campbell
Honored Contributor

Re: how to scp from HP unix 11.31 via both way to MS-windows

I can't say I would recommend cygwin in this case. Installing cygwin would be overkill in this application.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Bill Hassell
Honored Contributor

Re: how to scp from HP unix 11.31 via both way to MS-windows

Although there is a native ftp command in Windows, there is no native ssh in Windows. And just like ftp, there is no native ssh server in Windows. You'll need to add the server capability to Windows to allow scp from HP-UX to Windows.


Bill Hassell, sysadmin
Rita C Workman
Honored Contributor

Re: how to scp from HP unix 11.31 via both way to MS-windows

To go along with Mr. Hassell's suggestion.

When you add the Windows ssh software piece, make sure you get one that will read OpenSSH syntax. Many of them do not! Or they wrap the commands up to make them proprietary for their software.

Once you have the Windows ssh software properly loaded and you know how it works, then you can create your key on your UNIX box and send the pubic key to the Windows server for installation there. I recommend doing a one time 'ftp' of the file, so you can be sure it doesn't get corrupted. Follow the procedures to connect, "shake hands" to confirm certification and update your known_hosts. Make sure your Windows side keeps the proper ports open and then you can automate, via your script, to transfer files.

The biggest challenge I ran into was dealing with the Windows person who didn't know where or how to place the key on their server. Fortunately they contacted the vendor who walked them thru what to do.

Hope this helps,
Rgrds,
Rita
James_Lau
Frequent Advisor

Re: how to scp from HP unix 11.31 via both way to MS-windows

Hi Rita , can you please advice me how to go about the SSH key from hp unix to windows server ?