This is a discussion on Access denied within the Debian Linux support forums, part of the Debian Linux category; --> I want to open a file in the directory: /var/lib/asterisk/agi-bin with a text editor like Kate. (as normal user, ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I want to open a file in the directory: /var/lib/asterisk/agi-bin with a text editor like Kate. (as normal user, to copy and paste some text to another file) However... Acces denied. Q: How can I open a file in a texteditor with root priviliges? |
| |||
| Hi, I would think either su to root or sudo would work. Henk Oegema wrote: > I want to open a file in the directory: /var/lib/asterisk/agi-bin with a > text editor like Kate. (as normal user, to copy and paste some text to > another file) > > However... Acces denied. > > Q: How can I open a file in a texteditor with root priviliges? > > -- Philip Bernstein ppberns@hvc.rr.com |
| |||
| On Oct 13, 7:11 am, Henk Oegema <h...@oegema.com> wrote: > I want to open a file in the directory: /var/lib/asterisk/agi-bin with a > text editor like Kate. (as normal user, to copy and paste some text to > another file) > > However... Acces denied. > > Q: How can I open a file in a texteditor with root priviliges? Here are two sorta quickies. 1.) start Xterm. And su with your fav_editor. 2.) several distros have a "run command" listing that can be run as another user, including but not limited to root. - Peace - |
| |||
| On Sat, 13 Oct 2007 11:11:43 +0000, Henk Oegema wrote: > I want to open a file in the directory: /var/lib/asterisk/agi-bin with a > text editor like Kate. (as normal user, to copy and paste some text to > another file) > > However... Acces denied. > > Q: How can I open a file in a texteditor with root priviliges? Henk, you should get in the habit of giving a bit more information when you ask a question [1]. Yours is a question that is somewhat dependent on which distro you are using. The generic answer is, open the text editor as root, then navigate to the file you want to edit and open it. (That answers your question, but probably doesn't help you much.) How you open the text editor as root is the part that depends on the distro. Some distros automagically put the regular user in the sudoers, so all you would have to do would be prepend the sudo command, in a terminal, to the comand for your editor, in this case kate (As per your example, sudo kate /var/lib/asterisk/agi-bin). Other distros do not put the regular user in sudoers by default, so in them that wouldn't work unless you had set the user up as an sudoer. The command su, in a terminal, followed when prompted, by the root password would make root the user of that terminal and then, with the command kate you could open kate as root. This is a good time for you to read the manual pages for the two commands: man su man sudo These are not the only ways you could set up your system to have it work but they are probably enough for now. [1] http://www.catb.org/~esr/faqs/smart-questions.html |
| |||
| Rodney wrote: > Some distros automagically put the regular user in the sudoers, so > all you would have to do would be prepend the sudo command, in a terminal, > to the comand for your editor, in this case kate (As per your example, > sudo kate /var/lib/asterisk/agi-bin). Other distros do not put the regular > user in sudoers by default, so in them that wouldn't work unless you had > set the user up as an sudoer. The command su, in a terminal, followed when Thanks Rodney I'm using Debian 4.0r1 with GUI KDE henkoegema@asterisk:~$ su Password: asterisk:/home/henkoegema# kate Xlib: connection to ":0.0" refused by server Xlib: No protocol specified kate: cannot connect to X server :0.0 asterisk:/home/henkoegema# However... as normal user I can open Kate ! > prompted, by the root password would make root the user of that terminal > and then, with the command kate you could open kate as root. > > This is a good time for you to read the manual pages for the two commands: > man su > man sudo henkoegema@asterisk:~$ man sudo No manual entry for sudo henkoegema@asterisk:~$ kate [1]+ Stopped kate > > These are not the only ways you could set up your system to have it work > but they are probably enough for now. > > [1] http://www.catb.org/~esr/faqs/smart-questions.html |
| |||
| Henk Oegema wrote: > > I'm using Debian 4.0r1 with GUI KDE > > henkoegema@asterisk:~$ su > Password: > asterisk:/home/henkoegema# kate > Xlib: connection to ":0.0" refused by server > Xlib: No protocol specified > > kate: cannot connect to X server :0.0 > Try 'sux' from command line instead of 'su'. You have to install it (apt-get install sux)... -- Best regards Jacob Tranholm <http://jtranholm.dk/> Karl R. Popper: Observation statements and statements of experimental results are always interpretations of the facts observed. |
| |||
| Henk Oegema <henk@oegema.com> writes: >henkoegema@asterisk:~$ su >Password: >asterisk:/home/henkoegema# kate >Xlib: connection to ":0.0" refused by server >Xlib: No protocol specified > >kate: cannot connect to X server :0.0 >asterisk:/home/henkoegema# Easy: between su and kate, do the following: cp /home/henkoegema/.Xauthority ~ That's quick and dirty; if you have another session as root that also needs X, for a different display, use xauth to get the autority instead; I guess that sux tool someone else mentioned does that for you. Don't do "xhost +", it's a huge security hole: It allows everyone to access your display. - anton -- M. Anton Ertl Some things have to be seen to be believed anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen http://www.complang.tuwien.ac.at/anton/home.html |
| |||
| Anton Ertl wrote: > Henk Oegema <henk@oegema.com> writes: >>henkoegema@asterisk:~$ su >>Password: >>asterisk:/home/henkoegema# kate >>Xlib: connection to ":0.0" refused by server >>Xlib: No protocol specified >> >>kate: cannot connect to X server :0.0 >>asterisk:/home/henkoegema# > > Easy: between su and kate, do the following: > > cp /home/henkoegema/.Xauthority ~ henkoegema@asterisk:~$ cp /home/henkoegema/.Xauthority ~ cp: `/home/henkoegema/.Xauthority' and `/home/henkoegema/.Xauthority' are the same file henkoegema@asterisk:~$ > > That's quick and dirty; if you have another session as root that also > needs X, for a different display, use xauth to get the autority > instead; I guess that sux tool someone else mentioned does that for > you. Don't do "xhost +", it's a huge security hole: It allows > everyone to access your display. > > - anton |
| |||
| Rodney wrote: > >> >> (2007/10/13) Rodney wrote: >>> What happens when you try the command string- kdesu kate >>> /var/lib/asterisk/agi-bin >>> >>> If that didn't work try the command xhost +localhost then the command >>> string to start kate as su. >>> > > ? > > [code] > kdesu kate /var/lib/asterisk/agi-bin asterisk:/home/henkoegema# kdesu kate /var/lib/asterisk/uptime.php Xlib: connection to ":0.0" refused by server Xlib: No protocol specified kdesu: cannot connect to X server :0.0 > > [code] > xhost +localhost > su > password: > kate /var/lib/asterisk/agi-bin > > ? |
| ||||
| Henk Oegema <henk@oegema.com> writes: >Anton Ertl wrote: > >> Henk Oegema <henk@oegema.com> writes: >>>henkoegema@asterisk:~$ su >>>Password: >>>asterisk:/home/henkoegema# kate >>>Xlib: connection to ":0.0" refused by server >>>Xlib: No protocol specified >>> >>>kate: cannot connect to X server :0.0 >>>asterisk:/home/henkoegema# >> >> Easy: between su and kate, do the following: ^^^^^^^^^^^^^^^^^^^ >> >> cp /home/henkoegema/.Xauthority ~ > >henkoegema@asterisk:~$ cp /home/henkoegema/.Xauthority ~ >cp: `/home/henkoegema/.Xauthority' and `/home/henkoegema/.Xauthority' are >the same file I have underlined the part you did not heed. - anton -- M. Anton Ertl Some things have to be seen to be believed anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen http://www.complang.tuwien.ac.at/anton/home.html |