All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: bash_profile: Permission denied
@ 2004-09-23 18:13 James R. Marcus
  2004-09-23 18:21 ` Daniel J Walsh
  2004-09-23 19:21 ` Russell Coker
  0 siblings, 2 replies; 14+ messages in thread
From: James R. Marcus @ 2004-09-23 18:13 UTC (permalink / raw)
  To: Daniel J Walsh; +Cc: selinux

What is the right way to deal with this issue?  When root logs in should
they automatically be in the sysadm_r role or should these files be
labeled with staff_r?


Do I need to change this in /etc/security/selinux/file_contexts ?

This is what I have in file_contexts:
#
# User-specific file contexts
#
/root           -d      root:object_r:sysadm_home_dir_t
/root/.+                        root:object_r:sysadm_home_t
/root/\.ssh(/.*)?               root:object_r:sysadm_home_ssh_t
/root/.default_contexts --      system_u:object_r:default_context_t
/root/.ccache(/.*)?             system_u:object_r:sysadm_ccache_t


Thanks,
James
-----Original Message-----
From: Daniel J Walsh [mailto:dwalsh@redhat.com] 
Sent: Thursday, September 23, 2004 1:31 PM
To: James R. Marcus
Cc: selinux@tycho.nsa.gov
Subject: Re: bash_profile: Permission denied

James R. Marcus wrote:

>When I login in enforced mode I get this error as root:
>-bash: /root/.bash_profile: Permission denied
>ftp root # pwd       
>/root
>ftp root # ls -aZ
>ls: .: Permission denied
>ftp root #
>
>I thought it might be a labeling issue so I ran this command:
>ftp domains # newrole -r sysadm_r
>Authenticating root.
>Password: 
>ftp domains # cd /
>ftp / # setfiles /etc/security/selinux/file_contexts /root/
>setfiles:  read 575 specifications
>setfiles:  labeling files under /root/
>setfiles:  hash table stats: 5 elements, 5/65536 buckets used, longest
>chain length 1
>setfiles:  Done.
>
>I'm not getting any messages in /var/log/messages when I avc_toggle.
>
>
>Am I on the right track?
>
>James
>  
>
The problem is probably that you are logging as staff_r and the 
directory is sysadm_r.
At login do an id -Z to see what context you have,
then do the newrole -r sysadm_r and see if you have access to the
directory.

Dan

>
>
>
>
>--
>This message was distributed to subscribers of the selinux mailing
list.
>If you no longer wish to subscribe, send mail to
majordomo@tycho.nsa.gov with
>the words "unsubscribe selinux" without quotes as the message.
>  
>




--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: bash_profile: Permission denied
@ 2004-09-27 18:29 James R. Marcus
  0 siblings, 0 replies; 14+ messages in thread
From: James R. Marcus @ 2004-09-27 18:29 UTC (permalink / raw)
  To: russell, Luke Kenneth Casson Leighton; +Cc: Daniel J Walsh, selinux

Sorry I haven't replied to this sooner. I'm fine with .bash_profile
getting a permission denied.  The first issue was that when I was
switching back and forth from permissive to enforced mode, my new login
shell would hang on the permission denied error, and I would never get
to a prompt. Maybe this was an issue with my ssh client? This error
seems to be some extreme case, because without changing anything it
appears I can login as root while in enforced mode.

James

-----Original Message-----
From: owner-selinux@tycho.nsa.gov [mailto:owner-selinux@tycho.nsa.gov]
On Behalf Of Russell Coker
Sent: Friday, September 24, 2004 4:25 AM
To: Luke Kenneth Casson Leighton
Cc: Daniel J Walsh; James R. Marcus; selinux@tycho.nsa.gov
Subject: Re: bash_profile: Permission denied

On Fri, 24 Sep 2004 09:15, Luke Kenneth Casson Leighton <lkcl@lkcl.net>
wrote:
>  ah, but running newrole is not enough: not having write access to
>  /root/.bash_profile results in bash not _reading_ the file either.

I wrote the following in my previous message to James R. Marcus on the
same 
topic:

If you enable the boolean staff_read_sysadm_file then staff_t can read 
sysadm_home_t files and can search sysadm_home_dir_t directories.  This
will 
allow you to login as root:staff_r:staff_t without any warning messages
AND 
with the aliases etc from .bashrc defined.

-- 
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux
packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov
with
the words "unsubscribe selinux" without quotes as the message.



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* bash_profile: Permission denied
@ 2004-09-23 14:24 James R. Marcus
  2004-09-23 17:31 ` Daniel J Walsh
  0 siblings, 1 reply; 14+ messages in thread
From: James R. Marcus @ 2004-09-23 14:24 UTC (permalink / raw)
  To: selinux


When I login in enforced mode I get this error as root:
-bash: /root/.bash_profile: Permission denied
ftp root # pwd       
/root
ftp root # ls -aZ
ls: .: Permission denied
ftp root #

I thought it might be a labeling issue so I ran this command:
ftp domains # newrole -r sysadm_r
Authenticating root.
Password: 
ftp domains # cd /
ftp / # setfiles /etc/security/selinux/file_contexts /root/
setfiles:  read 575 specifications
setfiles:  labeling files under /root/
setfiles:  hash table stats: 5 elements, 5/65536 buckets used, longest
chain length 1
setfiles:  Done.

I'm not getting any messages in /var/log/messages when I avc_toggle.


Am I on the right track?

James





--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2004-10-02 16:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-23 18:13 bash_profile: Permission denied James R. Marcus
2004-09-23 18:21 ` Daniel J Walsh
2004-09-23 20:22   ` Russell Coker
2004-09-23 23:15     ` Luke Kenneth Casson Leighton
2004-09-24  8:24       ` Russell Coker
2004-09-23 19:21 ` Russell Coker
  -- strict thread matches above, loose matches on Subject: below --
2004-09-27 18:29 James R. Marcus
2004-09-23 14:24 James R. Marcus
2004-09-23 17:31 ` Daniel J Walsh
2004-10-01 22:37   ` Erich Schubert
2004-10-02  0:42     ` Greg Norris
2004-10-02  0:56     ` Russell Coker
2004-10-02  3:21     ` Richard Simpson
2004-10-02 16:21       ` Erich Schubert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.