How do I open a file as root in TextEdit on Lion? How do I open a file as root, in TextEdit? I've tried these commands as root, but TextEdit always say it's locked:

open -e /etc/apache2/httpd.conf
open -e -F /etc/apache2/httpd.conf
open -e -F -W /etc/apache2/httpd.conf


And of course sudo !! makes no difference.
You can open up a textedit instance as root by entering the full path to the actual executable :

sudo -b "/Applications/Textedit.app/Contents/MacOS/TextEdit"


Once your root instance is open you could browse to the file you need or do this from the command line :

sudo su - root -c "open -e /etc/apache2/httpd.conf"