how to change ssh port in RHEL 7.1

Latest response

hi anyone knows how to change ssh port in RHEL 7.1 Minimal installation?

I know it need to install policycoreutils-python in centos,
but there is no package in the 7.1 biner dvd iso.
if I try to install the rpm download from website, it was endless dependencies :(

so can anyone tell me how to install semanage in RHEL 7.1 Minimal installation os and change ssh port?

really appreciate!

Responses

Hello

from the sshd_config man page:

" Port Specifies the port number that sshd(8) listens on. The default is 22. Multiple options of this type are permitted. See also ListenAddress."

Read the section of the sshd_config man page where Port is mentioned and the part just above where it gives you the SELinux command you need to permit a non-standard port.

For the policycoreutils-python package, search on the downloads page, for example: https://access.redhat.com/downloads/content/69/ver=/rhel---7/7.1/x86_64/packages

Thanks Stephen :) Yes I know to change the ssh_config, but it requires semanage tool to add the specify port in to selinux. I was installed rhel 7.1 in minimal config, semanage tool is not in this system. when I trying to install policycoreutils-python, it just requires endless dependencies packages :( So I have to shutter Selinux.

Hello, then consider changing your question to "How to change SELinux port without using semanage"

I have never done this, so cannot say more than this might be possible by coping an SELinux policy module from one system to another.

I suggest raise a support request and also read:

Can SELinux policy files be copied over systems?

How to create a selinux policy module.

Hi Jiang

Do you have Yum Repository configured , you can install it using yum install

If not you can download it using yum downloadonly option and get the rpm.

yum install --downloadonly --downloaddir=

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.