Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: How to switch ssh port on RHEL #292

Open
rbo opened this issue Jul 17, 2023 · 0 comments
Open

Add: How to switch ssh port on RHEL #292

rbo opened this issue Jul 17, 2023 · 0 comments

Comments

@rbo
Copy link
Contributor

rbo commented Jul 17, 2023

  • Change vim /etc/ssh/sshd_config
    Result
    [root@pluto ~]# grep 'Port ' /etc/ssh/sshd_config
    Port 22
    Port 1984
    
  • Local firewqall: firewall-cmd --zone public --add-port 1984/tcp --permanent && firewall-cmd --reload
  • SELinux semanage port -a -t ssh_port_t -p tcp 1984
  • Adjust Hetzner Firewall:
    image
  • Reload sshd systemctl reload sshd
  • Check listen port:
    $ ss -tulpn | grep  1984
    tcp   LISTEN 0      128           0.0.0.0:1984       0.0.0.0:*    users:(("sshd",pid=1349,fd=3))                            
    tcp   LISTEN 0      128              [::]:1984          [::]:*    users:(("sshd",pid=1349,fd=4))                    
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant