Odd 'pscp' Behavior

General support questions
Post Reply
gw1500se
Posts: 191
Joined: 2012/05/07 13:53:35

Odd 'pscp' Behavior

Post by gw1500se » 2015/01/01 14:20:50

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.

User avatar
TrevorH
Forum Moderator
Posts: 29120
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Odd 'pscp' Behavior

Post by TrevorH » 2015/01/01 14:24:52

Why are you using pscp and not scp from the openssh-clients package?
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

gw1500se
Posts: 191
Joined: 2012/05/07 13:53:35

Re: Odd 'pscp' Behavior

Post by gw1500se » 2015/01/01 23:32:15

As I said, because scp does not let me put the password on the command line in the kickstart script.

Cookacoo
Posts: 15
Joined: 2014/09/26 00:03:53

Re: Odd 'pscp' Behavior

Post by Cookacoo » 2015/01/05 02:14:39

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

Post Reply

Return to “CentOS 7 - General Support”