PDA

View Full Version : [ubuntu] copying remotely - permission denied



ben22
April 24th, 2008, 06:49 PM
Hi,

with the following command I want to copy files from a MAC to Ubuntu PC using terminal:


$ scp -r folder_to_copy ben@192.168.0.142:/ben/backup

>> I get the error permission denied.

The passwords etc are correct, since with the same credentials I can SSH the Ubuntu pc from the mac.

Do I need to access via root the Ubuntu PC to be allowed to copy?

thx,
Ben

swoll1980
April 24th, 2008, 07:14 PM
try putting sudo in front of the command sudo scp -r folder_to_copy ben@192.168.0.142:/ben/backup see if that helps

prshah
April 24th, 2008, 07:26 PM
Hi,

$ scp -r folder_to_copy ben@192.168.0.142:/ben/backup
>> I get the error permission denied.


Does your remote folder /ben/backup have permissions allowing user "ben" to write/access the folder? If the backup folder is in ben's home folder, then the correct path will be "/home/ben/backup" or just "~/backup".

ben22
April 24th, 2008, 07:37 PM
try putting sudo in front of the command sudo scp -r folder_to_copy ben@192.168.0.142:/ben/backup see if that helps

Hi, I tried with sudo, but still get "permission denied" - sudo would also give root rights to the local user, but not to the user at the Ubuntu pc I would like to connect I guess?

ben22
April 24th, 2008, 07:38 PM
Does your remote folder /ben/backup have permissions allowing user "ben" to write/access the folder? If the backup folder is in ben's home folder, then the correct path will be "/home/ben/backup" or just "~/backup".

high thx, I forgot the ~ in the URL.

ben22
April 24th, 2008, 07:49 PM
Now I succeed in copying 1 file (the only one) that is in the folder, but not the complete folder itself.

What is the correct command for copying the complete folder?


$ scp -r folder_to_copy ben@192.168.0.142:/ben/backup