2

I have access to a file /etc/apache/myfile.conf that gets included in httpd.conf.

The permissions are:

-rw------- 1 root root

I have sudoedit permission to the file but not read!

I can open the file, edit it, but I just want to copy the entire content to take back up.

How do I do this?

1
  • Do you have regular sudo? Commented Jul 15, 2016 at 19:43

2 Answers 2

4

You can cheat by setting $EDITOR to cat e.g.

EDITOR=cat sudoedit /etc/apache/myfile.conf > copy_of_myfile.conf
3

If the only access you have is via sudoedit you could sudoedit the file and write it to a location you do have access to (e.g. /tmp or your home directory):

sudoedit /path/file
:w /newpath/newfile

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.