Ask Your Question
2

How to enable SSH port other than 22, after firewall-cmd etc...

asked 2017-03-25 00:01:42 -0600

gloriouspeanut gravatar image

updated 2018-11-04 03:18:20 -0600

hhlp gravatar image

I have installed the latest Fedora Server on my machine. After setup I was able to ssh in via terminal:

ssh -6 myuser@[Ipv6address]

and it worked fine. However, when attempting to change the port, I as root:

  • edited the sshd_config file
  • attempted to update semanage
  • found out semanage was not installed
  • installed packages for semanage
  • ran semanage port -a -t sshportt -p tcp [new port number]
  • used firewall-cmd to permanently add the new port number to my only active zone, FedoraServer and after every step have restarted sshd and used semanage port -l | grep ssh to confirm that ssh is running and the port is enabled. However when I attempt to log in:

ssh -6 myuser@[Ipv6address] -p [new port number]

I get: Permission denied

if I change sshd_config back to the default port it works fine. Any help?

edit retag flag offensive close merge delete

Comments

1

Did you reload the firewalld configuration?

jjelen gravatar imagejjelen ( 2017-07-11 10:31:11 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
-1

answered 2018-07-15 16:40:40 -0600

fedofix gravatar image

updated 2018-07-15 16:41:30 -0600

Deactivate SELINUX. Then reboot. and try to ssh your server.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-03-25 00:01:42 -0600

Seen: 627 times

Last updated: Jul 15 '18