I wanted to change my default SSH port to something else. Here are the commands I used:
1) I modified the "Port" value in my SSH config:
vi /etc/ssh/sshd_config
It was commented out. I uncommented it and modified it.
2) I installed "policycoreutils-python-utils" to gain access to the "semanage" command:
yum install policycoreutils-python-utils
3) I ran "semanage" to add my preferred SSH port to the allowd SSH ports:
semanage port -a -t ssh_port_t -p tcp xxxx
4) I checked to make sure it succeeded:
semanage port -l | grep ssh_port_t
5) I added a firewall exception for my preferred SSH port:
firewall-cmd --permanent --service="ssh" --add-port "xxxx/tcp"
6) I reloaded my firewall and SSH:
firewall-cmd --reload
systemctl reload sshd
7) I rebooted to make sure it all still worked correctly on boot:
reboot
Page Updates |
---|
RetroPie Arcade |
Customize New Linux Install |
Cisco CCNA Study :: Home Lab Notes |
PostgreSQL Backup Script |
Generate new Factorio map |
Recent Articles |
---|
Debug a Linux Kernel in QEMU |
Install xfce4 on Debian |
Console Blackjack in Perl |
Selenium::WebDriver::Error::UnknownError |
Game of Life in C++ using the SDL2 |
Copyright © 2005 - 2022
GregDonald.com · Contact · Nautical War · CRM12
All Rights Reserved