5.3.2. Configuring SSH for Remote Logins
SSH allows you to remotely log into a machine, transfer files, or execute commands. It is an indus-
try standard tool (
ssh
) and service (
sshd
) for connecting to machines remotely.
While the
openssh-server package is installed by default, the
SSH service is disabled by default and
thus is not started at boot time. You can manually start the SSH service with
systemctl start
ssh
or configure it to start at boot time with
systemctl enable ssh
.
The SSH service has a relatively sane default configuration, but given its powerful capabilities and
sensitive nature, it is good to know what you can do with its configuration file,
/etc/ssh/sshd_
config
. All the options are documented in
sshd_config(5)
(see section
6.1.1
, “
Manual Pages
”
[page 128])
The default configuration allows password-based logins. If this is not wanted, you can disable this
by setting PasswordAuthentication to no. Doing so will mean that and SSH key will need to be
generated. The SSH service listens by default on port 22 but you can change this with the Port
directive.
To apply the new settings, you should run
systemctl reload ssh
.