Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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 recently performed a massive update on my Gentoo system. I do not believe that this problem is Gentoo-specific, so I am posting in this forum. All the software and components of my system seem to be running fine. However, I am having a problem with X applications when su'ing in as root (perhaps other users too).
Code:
llama@llamatron ~ $ xclock
llama@llamatron ~ $ su
Password:
llamatron llama # xclock
Warning: Tried to connect to session manager, Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
xlock runs in both cases. However, I get that warning when under su. The problem is solved when I use su - root:
su - will invoke a login shell
if root uses bash for example, look at the difference between bash login shells and non-login shells.
Better read YOUR man page of bash because behaviour are different among versions.
Quote:
When bash is invoked as an interactive login shell, or as a non-interactive shell
with the --login option, it first reads and executes commands from the file
/etc/profile, if that file exists. After reading that file, it looks for
~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and exe*
cutes commands from the first one that exists and is readable. The --noprofile
option may be used when the shell is started to inhibit this behavior.
When a login shell exits, bash reads and executes commands from the file
~/.bash_logout, if it exists.
When an interactive shell that is not a login shell is started, bash reads and exe*
cutes commands from ~/.bashrc, if that file exists. This may be inhibited by using
the --norc option. The --rcfile file option will force bash to read and execute
commands from file instead of ~/.bashrc.
So login shells will execute /etc/profile then the first in ~/.bash_profile, ~/.bash_login, ~/.profile. That's it.
For non login shells (su without -), it only executes ~/.bashrc
su - will invoke a login shell
if root uses bash for example, look at the difference between bash login shells and non-login shells.
Better read YOUR man page of bash because behaviour are different among versions.
So login shells will execute /etc/profile then the first in ~/.bash_profile, ~/.bash_login, ~/.profile. That's it.
For non login shells (su without -), it only executes ~/.bashrc
So check these files.
Never seen this warning.
I'll get to the man pages tomorrow. My user and root's ~/.bash_profile just calls ~/.bashrc. The user and root's .bashrc only have some simple aliases and xterm title cases.
Now - I created a new user when I did my massive upgrade because I didn't want obsolete 2+ year old dot-files polluting my home directory. Investigating my original .bashrc reveals:
Code:
alias su="su -"
Perhaps I have always been prone to this warning. Oh well, it isn't fatal and I can just use this alias to fit my habit of only typing 'su'.
BTW, I just re-read my thread title.. Sort of redundant, huh?
Last edited by AngryLlama; 02-01-2007 at 03:05 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.