Changing SSH and Apache ports

Scot L. Harris webid at
Wed Dec 14 22:00:42 UTC 2005

On Wed, 2005-12-14 at 16:51, Dotan Cohen wrote:
> I thought that this would be easy, but I am having no luck.
> Could some please point me to a tutorial whereby I could learn to
> change what port I would use to ssh into my Fedora Core 4 machine? I
> once read one, but all the googleing in the world isn't turning it
> back up. I would also like to leave apache up to show off some things,
> how could I change it's port number as well?
> Thanks in advance. Please accept my apolozies for this STFW- I am
> "S"ing but not finding anything.

The easiest thing to do is read through the /etc/ssh/sshd_config file.

In there you can specify any number of ports for ssh to listen using
something similar to:

Port 22
Port 3080

Other good ones to set in sshd_config:

PermitRootLogin no

Protocol 2


Where YOURUSERNAME is the login id you want to allow to use ssh on that

You may also want to set:

X11Forwarding yes
Compression yes

Check out the man page:

man sshd_config for more details.

More information about the fedora-list mailing list