Need to copy a file from unix box to windows folder using pscp command

4

1

I have a unix svr A:

username: uname
password: pwd

then there are some files under /usr/local/jboss/configuration which are accessible only when a 'sudo su' command is performed. (and the username changes to root@svrname ,also no password prompted for this command)

Now, I am trying to execute the below command which is trying to copy the file available under /usr/local/jboss/configuration to my local machine.

pscp -pw pwd root@svrname:/usr/local/jboss/configuration/xyz.xml C:\Users\downloads\

but this command prompts for password, m clueless. Please help!!

suraj

Posted 2012-08-24T16:24:09.197

Reputation: 41

Answers

0

It's likely that your ssh server is configured to disallow remote root logins. Check your /etc/ssh/sshd_config on the server.

Charles Burge

Posted 2012-08-24T16:24:09.197

Reputation: 1 792

0

how about coying the files some place where "uname" can access them

uname@svrname:~$ sudo cp -r /usr/local/jboss/ ~/
uname@svrname:~$ sudo chown -R uname ~/jboss/

and then on your windows machine:

pscp -pw pwd uname@svrname:~/jboss/configuration/xyz.xml C:\Users\downloads\

Raouf M. Bencheraiet

Posted 2012-08-24T16:24:09.197

Reputation: 104

0

how did you set the variable pwd (should be $pwd)? does it have special characters? check that carefully and echo $pwd to make sure that it has your exact password.

then take a look a look at your auth or secure log on the server to see what error you are getting. it should tell you if your password is accepted or not.

also, make sure your root user can log into remotely (not a good idea, but if the server is only accessible in your internal network then it is fine).

johnshen64

Posted 2012-08-24T16:24:09.197

Reputation: 4 399

the pwd isn't a variable, sorry if this confused you. the password to login to the svr is 'pwd' that's what I meant here – suraj – 2012-08-27T09:34:07.463