linux
centos 8 - ssh 포트 변경
sysman
2020. 11. 24. 19:58
yum list | grep ssh //ssh 있는지 체크
yum install -y openssh-server openssh-clients //없으면 설치
vi /etc/ssh/sshd_config //ssh환경설정에 변경할 포트 넣기
port xxxx
firewall-cmd --permanent --zone=public --add-port=xxxx/tcp //방화벽에 해당 포트 open
firewall-cmd --zone=public --list-all //방화벽 list 포트 확인
systemctl status sshd.service //ssh 데몬 확인
systemctl reload sshd.service //ssh 데몬 restart
"code=exited, status=255" 에러 확인 시 하기 설정 필요
semanage port -l | grep xxxx //해당 포트 겹치는 포트 있는지 확인
semanage port -a -t ssh_port_t -p tcp xxxx //포트 적용
semanage port -l | grep ssh_port_t //포트 적용 되었는지 확인
netstat -aprn | grep LISTEN // 해당 포트 확인