LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 02-01-2007, 02:34 AM   #1
AngryLlama
Member
 
Registered: Sep 2004
Location: /dev/urandom
Distribution: Gentoo
Posts: 171

Rep: Reputation: 31
su and rejected session manager rejection.


Hello -

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:

Code:
llama@llamatron ~ $ su - root
Password: 
llamatron ~ # xclock
Strange... I've never used the hyphen before with su, but it works. I would like to return to my normal method of su if possible.

Thanks
 
Old 02-01-2007, 02:39 AM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
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

So check these files.
Never seen this warning.
 
Old 02-01-2007, 02:56 AM   #3
AngryLlama
Member
 
Registered: Sep 2004
Location: /dev/urandom
Distribution: Gentoo
Posts: 171

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by nx5000
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.
 
Old 02-01-2007, 03:54 AM   #4
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
Originally Posted by AngryLlama
BTW, I just re-read my thread title.. Sort of redundant, huh?
Didn't see it the first time


alias su="su -" hummmmm this is not so clever

su - leads to
su - -
?
I wonder whats the result..

yes bash profile calls bashrc, its a shortcut that bash takes.
But if the user has a different shell then probably .profile is called only.

Last edited by nx5000; 02-01-2007 at 03:56 AM.
 
Old 02-01-2007, 06:52 PM   #5
AngryLlama
Member
 
Registered: Sep 2004
Location: /dev/urandom
Distribution: Gentoo
Posts: 171

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by nx5000
Didn't see it the first time


alias su="su -" hummmmm this is not so clever

su - leads to
su - -
?
I wonder whats the result..

yes bash profile calls bashrc, its a shortcut that bash takes.
But if the user has a different shell then probably .profile is called only.
Sigh.. I will just switch to using 'su -', although it would be nice to know what the underlying issue is.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"mythtv-setup" giving "Session management error: Authentication Rejected" Mitchua Ubuntu 0 10-09-2005 04:32 PM
Error: "Tried to connect to session manager, Authentication Rejected, reason : None" randomx Linux - Software 0 01-24-2005 03:44 PM
Session Manager Hectic Slackware 1 10-10-2004 09:13 PM
xfce x session manager dthomp325 Linux - Software 1 01-10-2004 03:11 PM
Rox Session Manager ferreter Linux - General 1 10-05-2002 04:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration