Bug 425982

Summary: (selinux) chsh fails to set scponly
Product: [Fedora] Fedora Reporter: Warren Togami <wtogami>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Current Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-01-30 19:20:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Warren Togami 2007-12-17 15:55:56 UTC
[root@newcaprica ~]# yum install scponly
[root@newcaprica ~]# chsh test
Changing shell for test.
New shell [/bin/bash]: /usr/bin/scponly
chsh: "/usr/bin/scponly" is not executable.

type=AVC msg=audit(1197906784.995:40): avc:  denied  { execute } for  pid=7906
comm="chsh" name="scponly" dev=dm-3 ino=364718
scontext=unconfined_u:system_r:chfn_t:s0-s0:c0.c1023
tcontext=system_u:object_r:bin_t:s0 tclass=file
type=SYSCALL msg=audit(1197906784.995:40): arch=c000003e syscall=21 success=no
exit=-13 a0=2aaaaaccea90 a1=1 a2=2aaaaacceaa0 a3=0 items=0 ppid=7512 pid=7906
auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1
comm="chsh" exe="/usr/bin/chsh" subj=unconfined_u:system_r:chfn_t:s0-s0:c0.c1023
key=(null)

Can this be fixed in selinux-policy?

Comment 1 Warren Togami 2007-12-17 16:25:05 UTC
NOTE: scponly is not a normal general-purpose shell.  It is meant to restrict a
user to use only scp or sftp for file transfers.  They should not be able to run
other commands or obtain a real shell.  Is there any way to restrict scponly
from using other commands or obtaining a real shell?

Comment 2 Daniel Walsh 2007-12-18 16:40:13 UTC
The latest updated policy should fix this, 

selinux-policy-3.2.4-3 allows chsh/chfn to execute bin_t.

Currently we transition to usertype_t when you login via ssh.  (unconfined_t,
user_t, guest_t)

So we could attempt a special label for this shell, but I think we would end up
needing to modify sshd or pam_selinux to get it to work correctly.

Fixed in selinux-policy-3.2.4-3.fc9


Comment 3 Daniel Walsh 2008-01-30 19:20:16 UTC
Bulk closing all bugs in Fedora updates in the modified state.  If you bug is
not fixed, please reopen.