Gentoo Archives: gentoo-hardened

From: Andrew Ross <aross@g.o>
To: gentoo-hardened@l.g.o
Subject: [gentoo-hardened] SELinux preventing sshd from listening on ports other than 22
Date: Wed, 21 Nov 2007 04:48:03
Message-Id: 4743B80B.50109@gentoo.org
In Reply to: [gentoo-hardened] Excessive SELinux avc denials by Will Keaney
1 Will Keaney wrote:
2 > I've just finished updating my SELinux VM, but still get a lot of avc
3 > denials in /var/log/syslog. What is the recommended method of
4 > changing the SELinux policy? I seem to remember PeBenito saying in
5 > IRC that editing the policy files directly is not recommended.
6
7 > avc: denied { name_bind } for pid=5164 comm="sshd" src=2222
8 > scontext=system_u:system_r:sshd_t tcontext=system_u:object_r:port_t
9 > tclass=tcp_socket
10
11 I'm new to SELinux myself, but I'm almost certain I can be of help here.
12
13 You've configured sshd to listen on port 2222 instead of the default 22,
14 but SELinux policy states that sshd can only bind to ports labelled with
15 the type ssh_port_t. The semanage command can be used to adjust port
16 labels e.g.
17
18 semanage port -a -t ssh_port_t -p tcp 2222
19
20 Cheers
21
22 Andrew

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies