Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|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
1  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.