selinux and using different port for sshd than usual 22

Support for security such as Firewalls and securing linux
Post Reply
cdm
Posts: 17
Joined: 2014/02/17 18:22:56

selinux and using different port for sshd than usual 22

Post by cdm » 2016/04/02 21:12:03

Hello All,

Initially I was using port 8080 for my sshd, then i wanted to change it to some other port but of course selinux didn't like it. I forgot how i initially i setup selinux to allow port 8080 for sshd since i had it as enforcing (i thought) all along from long ago. Now i want to set it up on another port besides 22 and upon researching, it seems that one would use semanage but i can't find the executable anywhere. I think i read that it's part of the policycoreutils and it should be here: /usr/sbin/semanage . . . . but it's not. And i already have policycoreutils installed. so i'm a bit confused. any help or suggestions would be nice. thanks.

scottro
Forum Moderator
Posts: 2556
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: selinux and using different port for sshd than usual 22

Post by scottro » 2016/04/02 21:23:28

New users should check the FAQ and Read Me First pages

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: selinux and using different port for sshd than usual 22

Post by TrevorH » 2016/04/02 23:00:00

It's not a good pidea to move the ssh port to above 1024 as any user can bind to those ports. You should keep it under 1024 and then if someone manages to somehow crash your sshd, they cannot start it up as a non-root user and have it bind to your new port.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

cdm
Posts: 17
Joined: 2014/02/17 18:22:56

Re: selinux and using different port for sshd than usual 22

Post by cdm » 2016/04/04 14:54:55

ok - i'll look at the faq . . . . . but i'm just trying to figure out why i don't seem to have 'semanage' on a system which has selinux on it. how is selinux supposed to be managed ?

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: selinux and using different port for sshd than usual 22

Post by TrevorH » 2016/04/04 16:56:59

By installing the package that contains the semanage executable.... yum provides '*/semanage'
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply