Ask Your Question

Do I need to (and how to) restart restart ssh / sshd after changes to config on fedora cloud

asked 2015-09-20 18:55:47 -0500

WillyNolan gravatar image

I want to change the port of ssh on my Linux cloud machine. In the /etc/ssh/sshd_config file I see:

# 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 22
#AddressFamily any
#ListenAddress ::

My understanding is that I just need to uncomment the Port line and change the port number - Do I also have to run the command specified in the first three lines (from selinux?)

Lastly, trying to "restart" ssh with no luck. I have tried

sudo /sbin/sshd restart and I get (Extra argument restart.)

In other places I get Error: Access Denied even when I am using sudo.

Can someone please explain to me the exact process to change the port, or any settings in SSH (like if I have to change it in the root / default file or a user file), and how I can / should restart ssh on Fedora Cloud (23)? Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-09-20 20:23:59 -0500

hmaarrfk gravatar image

updated 2015-09-20 20:24:19 -0500

Fedora uses systemd
systemctl restart sshd
should do the trick


edit flag offensive delete link more


That is what I thought, however, I still get a Failed to restart sshd.service: Access denied. Changing Selinux to "permissive" with setenforce 0 gives me this message: Failed to restart sshd.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files Any ideas?

WillyNolan gravatar imageWillyNolan ( 2015-09-21 21:45:47 -0500 )edit

so strange... sorry. no clue.

hmaarrfk gravatar imagehmaarrfk ( 2015-09-22 00:28:48 -0500 )edit

Question Tools


Asked: 2015-09-20 18:55:47 -0500

Seen: 3,143 times

Last updated: Sep 20 '15