SlackwareThis Forum is for the discussion of Slackware 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.
I tried it but I still can't open gui apps just by using su:
Code:
bash-4.1$ su -l -
Password:
So you think that money is the root of all evil.
Have you ever asked what is the root of money?
-- Ayn Rand
root@Greg-PC:~# mousepad
No protocol specified
(mousepad:2347): Gtk-WARNING **: cannot open display: :0.0
root@Greg-PC:~#
I know there is a work-around for this but considering how rarely I need to do this that I find it easier to remember to login as root if I am doing anything fancy.
You need to read the 'man page' again. This is the format of the 'su' command;
Quote:
su [options] [username]
You would use 'su -'to get the 'root' environment as to this explaination;
Quote:
Invoked without a username, su defaults to becoming the Superuser. The optional argument - may be used to provide an environment similar to what the user would expect had the user logged in directly.
Simply you would choose either '-' to get environment for user, if nothing trails the '-' you get superuser/root. For '-l' or '--login' you would get the login for the user selected.
Quote:
-, -l, --login
Provide an environment similar to what the user would expect had the user logged in directly.
When - is used, it must be specified as the last su option. The other forms (-l and --login) do not have this restriction.
repo@cannabis ~]$ xhost +
access control disabled, clients can connect from any host
repo@cannabis ~]$ su -c program
Well.....you really don't what just any client to access from just any host. It is best to specify who and where explicitly. Of course, it depends on how much you are worried about security.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.