Bug 425982 - (selinux) chsh fails to set scponly
(selinux) chsh fails to set scponly
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Daniel Walsh
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-12-17 10:55 EST by Warren Togami
Modified: 2008-01-30 14:20 EST (History)
0 users

See Also:
Fixed In Version: Current
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-01-30 14:20:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Warren Togami 2007-12-17 10:55:56 EST
[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
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

Can this be fixed in selinux-policy?
Comment 1 Warren Togami 2007-12-17 11:25:05 EST
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 11:40:13 EST
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 14:20:16 EST
Bulk closing all bugs in Fedora updates in the modified state.  If you bug is
not fixed, please reopen.

Note You need to log in before you can comment on or make changes to this bug.