I'm sure it's been asked and answered many times, but I can't seem to find an answer. Maybe this question will link someone else to the right answer.

Here's the problem:

~$ sudo ls
ls: cannot open directory .: Permission denied

Here's what I want to do:

~$ sudo cp synergy.conf /etc

Here's what happens:

cp: cannot stat `synergy.conf': Permission denied

Here's what I end up doing:

~$ cp synergy.conf /tmp
~$ sudo cp /tmp/synergy.conf /etc/

What can I do to make this easier? Is there a way to give sudo privileges to see my home directory?

link|improve this question
Assuming you're sudo-ing to root, why not just use su -c when sudo hits corner cases? – new123456 Aug 9 '11 at 21:10
is your current directory on a remote machine? – Pablo Castellazzi Aug 9 '11 at 23:26
I am sudo'ing to root. su -c has the same problem: $ sudo su -c "mv foo /etc" yields mv: cannot open 'foo' for reading: Permission denied. My current directory is on a local machine. Yes. – umop Aug 15 '11 at 22:01
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.