Re: su Permission Problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gerry Doris writes....
> 
> I have two systems running Redhat.  One is using 7.3 and the other 8.0.  
> On the 7.3 system when I as root do 
> 
> su gerry
> 
> I end up with a prompt as user gerry.  However, when I do the same
> thing on the 8.0 system I get the following
> 
> su gerry
> /bin/bash: /root/.bashrc: Permission denied
> 
> but I still end up with a prompt as user gerry.  I assume the correct
> behaviour is the 7.3 system version.  Does anyone know why the bash error
> appears?  I tried using
> 
> su - gerry
> 
> and it works without errors.  I can't see anything obvious with 
> permissions on the /root/.bashrc file.  On both systems the file is 
> owned by root.root with permissions of 644.  I'm not sure where else to 
> look?

Check the premissions on ~gerry/.bashrc
That's probably 600 or 700, or something that only gerry can
execute.

I'm sure someone can (will) explain "correctly" the complete
difference in su and su -.
But in general, su - gerry effectively makes you gerry.  Runs
just as if you had initially logged in as gerry.
su gerry leaves a lot of the things from root hanging around.
Enviornment variables for one thing.
Try both ways and look at something like,  "echo $MAIL"
(your mail spool.)
su - gerry will probably show the mail spool for gerry.
su gerry will still be root.

Personally, I ALWAYS use the dash (su - USER).
Leave all remnience of root behind so you don't end up with suprises.
(Though I'm sure some folks can tell you their reasons for just su USER.

-- Jay Crews
jpc@jaycrews.com

> 
> -- 
> Gerry
> 
> "The lyfe so short, the craft so long to learne"  Chaucer



-- 
Psyche-list mailing list
Psyche-list@redhat.com
https://listman.redhat.com/mailman/listinfo/psyche-list

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux