Running GUI apps frm terminal while logged in as normal user
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Running GUI apps frm terminal while logged in as normal user
Hello, I seem to have a problem running gui apps as 'root' from the commandline while logged in as a normal user. Output from screen from a typical attempt is as follows:
root@debian:/home/deviant# gedit /etc/apt/sources.list
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
kedit: cannot connect to X server :0.0
What solutions are there for me? Do I need to edit some config files and if so which ones? What lines must I add and which part of the file or files i.e. top or end of file/files? Or do I just need to pass some commands in a terminal to fire up gui apps as 'root' while logged in as an ordinary user from the shell?
Originally posted by muttley Problem resolved. Found a solution but I suspect it could be a "per session" fix and not a permanent answer.
Put it in your /root/.bashrc and it will be there every time you su to root as the user named in the line. This assuming of course that you have uncommented the lines in the /root/.bash_profile to source the .bashrc.
Originally posted by HappyTux Put it in your /root/.bashrc and it will be there every time you su to root as the user named in the line. This assuming of course that you have uncommented the lines in the /root/.bash_profile to source the .bashrc.
Thank you HappyTux. Edited /root/.bashrc with nano and inserted the appropriate i.e. above-mentioned line as advised. Things are working fine thus far.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.