root로 작업



1. semanage 설치


[root@localhost ellord]# yum install policycoreutils-python




2. 현재 사용중인 sshd 포트 확인 (당연히 22가 나온다)

[root@localhost ellord]# semanage port -l | grep ssh

ssh_port_t                     tcp       22




3. 22233 을 추가하려고 한다.



[root@localhost ellord]# semanage port -a -t ssh_port_t -p tcp 22233





4. 추가되었는지 다시 확인해 본다.


[root@localhost ellord]# semanage port -l | grep ssh

ssh_port_t                     tcp      22233, 22



22233이 추가되었다.



5. sshd 데몬에도 추가한다.


root@localhost ellord]# vi /etc/ssh/sshd_config 



[root@localhost ellord]# vi /etc/ssh/sshd_config 

#       $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $


# This is the sshd server system-wide configuration file.  See

# sshd_config(5) for more information.


# This sshd was compiled with PATH=/usr/local/bin:/usr/bin


# The strategy used for options in the default sshd_config shipped with

# OpenSSH is to specify options with their default value where

# possible, but leave them commented.  Uncommented options override the

# default value.


# If you want to change the port on a SELinux system, you have to tell

# SELinux about this change.

# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER

#

Port 22233


주석처리된 Port 22 에 주석을 풀고 22233으로 변경해 준다.



5. sshd 를 재시작한다.


[root@localhost ellord]# systemctl restart sshd



6. 접속해 본다.


ELLORDNET-MPR:~ ellord$ ssh 서버아이피 -p 22233




끝.

'Linux' 카테고리의 다른 글

rsync @ERROR: chroot failed  (0) 2019.01.08
CentOS7 apache 2.4 mod_deflate  (0) 2017.11.26
아파치 OpenSSL 사설인증서 적용  (0) 2016.12.06
iconv euckr to utf8 파일명  (0) 2016.12.06
텍스트파일 텍스트 치환  (0) 2016.12.06
블로그 이미지

엘로드넷

,