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?

clk
  • 2,146
Kalpesh Soni
  • 141
  • 4

2 Answers2

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