Http web server - # The length of the key in bits.
# The length of the key in bits. ServerKeyBits 1024 # Should we allow root logins via ssh? PermitRootLogin no # Should the ssh daemon check users’ home directory and files permissions? # are safe before allowing login? StrictModes yes # Should we allow old ~/.rhosts and /etc/hosts.equiv authentication method? RhostsAuthentication no # Should we allow pure RSA authentication? RSAAuthentication yes # Should we allow password authentication? PasswordAuthentication yes # Should we allow /etc/hosts.equiv combined with RSA host authentication? RhostsRSAAuthentication no # Should we ignore ~/.rhosts files? IgnoreRhosts yes # Should we allow logins to accounts with empty passwords? PermitEmptyPasswords no It’s important to make sure the permissions of the configuration files are correct to ensure that system security is maintained. Use the following commands: # chown -R root:root /etc/ssh # chmod 755 /etc/ssh # chmod 600 /etc/ssh/ssh_host_key # chmod 644 /etc/ssh/ssh_host_key.pub # chmod 644 /etc/ssh/sshd_config The final stage of sshd administration daemon is to run it. Normally you’d create an rc file for it or add it to an existing one, so that it is automatically executed at boot time. The daemon runs standalone and doesn’t require any entry in the /etc/inetd.conf file. The daemon must be run as the root user. The syntax is very simple: /usr/sbin/sshd The sshd daemon will automatically place itself into the background when being run. You are now ready to accept ssh connections. The ssh client There are a number of ssh client programs: slogin, scp and ssh. They each read the same configuration file, usually called /etc/ssh/ssh_config. They each also read configuration files from the .ssh directory in the home directory of the user executing them. The most important of these files is the .ssh/config file, which may contain options that override those specified in the /etc/ssh/ssh_config file, the .ssh/identity file, which contains the user’s own private key, and the corresponding .ssh/identity.pub file, containing the user’s public key. Other important files are .ssh/known_hosts and .ssh/authorized_keys; we’ll talk about those later in “Using ssh”. First, let’s create the global configuration file and the user key file. /etc/ssh/ssh_config is very similar to the server configuration file. Again, there are lots of features you can configure, but a minimal configuration looks like that presented in Example 12.5. The rest of the configuration options are detailed in the sshd(8) manpage. You can add sections that match specific hosts or groups of hosts. The parameter to the “Host” statement may be either the full name of a host or a wildcard specification, as we’ve used in our example, to match all hosts. We could create an entry that used, for example, Host *.vbrew.com to match any host in the vbrew.com domain.