Page 1 of 1

Odd 'pscp' Behavior

Posted: 2015/01/01 14:20:50
by gw1500se
I am trying to set up a kickstart file to build a new server from an old one. One of the things I need to do is copy the /var/www tree to the new server so I am using putty which is all I can find that will let me include the password in my kickstart %post script. However, the authentication is working but the actual copy is very bizarre. Most of my files are in /var/www/html. Here is my 'pscp' command line"

Code: Select all

pscp -q -r -p -pw ********** root@192.168.0.3:/var/www /var
The source looks like this:

Code: Select all

ls /var/www
certs  cgi-bin  error  html  icons  passwords
The bizarre part is that except for 'html' none of these directories or files are copied. Instead SOME of the files and directories in 'html' are copied to this level (/var/www) and the rest are copied to the correct level (/var/www/html). I do not see any particular pattern to which files are copied where. All files have the same owner/group. What could possibly cause this? TIA.

Re: Odd 'pscp' Behavior

Posted: 2015/01/01 14:24:52
by TrevorH
Why are you using pscp and not scp from the openssh-clients package?

Re: Odd 'pscp' Behavior

Posted: 2015/01/01 23:32:15
by gw1500se
As I said, because scp does not let me put the password on the command line in the kickstart script.

Re: Odd 'pscp' Behavior

Posted: 2015/01/05 02:14:39
by Cookacoo

Code: Select all

pscp -q -r -p -pw ********** root@192.168.0.3:/var/www /var
Try this instead.

Code: Select all

pscp -q -r -p -pw ********** root@192.168.0.3:/var/www /var/
the difference being the slash at the end.

I would also suggest using scp, and instead of using a password use a ssh key, you are able to indetiy a key file to be used in either pscp or scp, and it is basically like using a 1000+ character password, that is stored on the machine. (You will need to look into "passwordless login" to get the information you need, and don't be fooled, it is more secure than using just a password login.

Code: Select all

#From man scp
     -i identity_file
             Selects the file from which the identity (private key) for public
             key authentication is read.  This option is directly passed to
             ssh(1).
I would also suggest using rsync over scp less network traffic, and sym links don't cause issues. and rsync has basically the same syntax and runs over port 22, but may need to be installed.

Hope this helps. =D