0

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?

3
  • Assuming you're sudo-ing to root, why not just use su -c when sudo hits corner cases?
    – new123456
    Aug 9, 2011 at 21:10
  • is your current directory on a remote machine? Aug 9, 2011 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, 2011 at 22:01

0

You must log in to answer this question.

Browse other questions tagged .