Bug 464737

Summary: Missing suggestion when using alternate SSH port
Product: [Fedora] Fedora Reporter: Arthur Pemberton <pembo13>
Component: setroubleshoot-pluginsAssignee: Thomas Liu <tliu>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dwalsh, jdennis, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-06-29 14:48:20 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:
Attachments:
Description Flags
Output of sealert -l 28e7eaf0-bce4-42f1-b115-5a6ab234c03f
none
Output of sealert -l 82267d8b-d557-4891-bdb0-26e0feb1e986 none

Description Arthur Pemberton 2008-09-30 02:28:46 UTC
Description of problem:
SELinux denies SSHd when attempting to use an alternate port (23). setroubleshoto suggests writing a custom policy.

Version-Release number of selected component (if applicable):
setroubleshoot-server-2.0.8-2.fc9.noarch

How reproducible:
Every time

Steps to Reproduce:
1. add a non-standard port to /etc/ssh/sshd_config
2. service sshd restart
3. check /var/log/messages
  
Actual results:
sealert -l 28e7eaf0-bce4-42f1-b115-5a6ab234c03f

Expected results:
semanage port -m -t ssh_port_t -p tcp 23

Additional info:
Doing `semanage port -m -t ssh_port_t -p tcp 23` itself leads to another denial, I haven't verified that port 23 works as expected. Doing ssh -p 23 from another machine did however work:
sealert -l 82267d8b-d557-4891-bdb0-26e0feb1e986

Comment 1 Daniel Walsh 2008-09-30 15:05:10 UTC
Please attach the output

sealert -l  82267d8b-d557-4891-bdb0-26e0feb1e986 
only works on your machine.

Comment 2 Arthur Pemberton 2008-09-30 15:16:06 UTC
Created attachment 318089 [details]
Output of sealert -l 28e7eaf0-bce4-42f1-b115-5a6ab234c03f

Comment 3 Arthur Pemberton 2008-09-30 15:17:13 UTC
Created attachment 318090 [details]
Output of sealert -l 82267d8b-d557-4891-bdb0-26e0feb1e986

Comment 4 Daniel Walsh 2008-09-30 15:47:34 UTC
Not sure what is causing the second avc.  The semanage command looks like it fixed your real problem.

The second avc looks like a leaked file descriptor, from the unconfined processess that was used to restart sshd.  Did you restart sshd from a gui?

It can be ignored, as it is really not blocking anything.

Comment 5 Arthur Pemberton 2008-09-30 15:53:28 UTC
no, I just did a `service sshd restart` from the shell. As you noted, it seems like the actual semanage worked, this is why I did not file a bug for it.

Comment 6 Daniel Walsh 2008-10-01 12:28:46 UTC
Then this looks like you have a leaked file descriptor in your shell.  What virtual terminal were you using? If you ls -l /proc/self/fd does it show anything interesting?

Comment 7 Arthur Pemberton 2008-10-03 05:29:31 UTC
I am using Konsole


# ls -l /proc/self/fd
total 0
lrwx------ 1 root root 64 2008-10-03 00:28 0 -> /dev/pts/2
lrwx------ 1 root root 64 2008-10-03 00:28 1 -> /dev/pts/2
lrwx------ 1 root root 64 2008-10-03 00:28 2 -> /dev/pts/2
lr-x------ 1 root root 64 2008-10-03 00:28 3 -> /proc/8180/fd

Comment 8 Daniel Walsh 2008-10-03 13:49:41 UTC
And if you execute service sshd restart right now, does it generate the avc?

Comment 9 Arthur Pemberton 2009-05-04 06:27:08 UTC
This issue is pretty old. I am currently on F10, and there are of course no problems as I am on a default setup.

The original issue should have been filed as an RFE to provide the user with a suggestion on how to `semanage` their new port of choice to sshd

Comment 10 Bug Zapper 2009-06-10 02:50:45 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 11 Daniel Walsh 2009-06-29 14:48:20 UTC
ssh is now allowed to bind to any port so this is not a bug anymore.  We need to allow ssh to bind to all ports in order to allow port forwarding.