The configuration file for sshd2 /etc/ssh2/sshd2_config allows you to set options that modify the operation of the daemon. The files contain keyword-value pairs, one per line, with keywords
being case insensitive. Here are the more important keywords; a complete listing is available in the man page for sshd2(8).
Edit the sshd2_config file (vi /etc/ssh2/sshs2_config and add or change, if necessary:
# sshd2_config
# SSH 2.0 Server Configuration File
*:Port 22
ListenAddress 192.168.1.1
Ciphers blowfish
IdentityFile identification
AuthorizationFile authorization
HostKeyFile hostkey
PublicHostKeyFile hostkey.pub
RandomSeedFile random_seed
ForwardAgent no
ForwardX11 no
PasswordGuesses 3
MaxConnections 5
PermitRootLogin no
AllowedAuthentications publickey,password
RequiredAuthentications publickey,password
VerboseMode no
PrintMotd yes
CheckMail yes
UserConfigDirectory "%D/.ssh2"
SyslogFacility DAEMON
Ssh1Compatibility no
NoDelay yes
KeepAlive yes
UserKnownHosts yes
AllowHosts 192.168.1.4
DenyHosts *
QuietMode no
# subsystem definitions
subsystem-sftp sftp-server
This tells sshd2_config file to set itself up for this particular configuration setup with:
-
Port 22 The option
Portspecifies which port number the ssh2 daemon listens to for ssh incoming connection. The default port is 22.-
ListenAddress 192.168.1.1 The option
ListenAddressspecifies the IP address of the interface network on which the ssh2 daemon server socket is bound. The default is0.0.0.0; to improve security you may specify only the required ones to limit possible addresses.-
Ciphers blowfish The option
Ciphersspecifies what cipher should be used for encrypting sessions. The blowfish uses 64-bit blocks and keys of up to 448 bits.-
IdentityFile identification The option
IdentityFilespecifies an alternate name for the user's identification file.-
AuthorizationFile authorization The option
AuthorizationFilespecifies an alternate name for the user's authorization file.-
HostKeyFile hostkey The option
HostKeyFilespecifies an alternate file containing the private host key. The default is/etc/ssh2/hostkey.-
PublicHostKeyFile hostkey.pub The option
PublicHostKeyFilespecifies an alternate file containing the public host key. The default is/etc/ssh2/hostkey.pub.-
RandomSeedFile random_seed The option
RandomSeedFilespecifies an alternate name for the user's random seed file.-
ForwardAgent no The option
ForwardAgentspecifies which connection authentication agent if any should be forwarded to the remote machine.-
ForwardX11 no The option
ForwardX11is for people that use theXwindowGUI and want to automatically redirectX11sessions to the remote machine. Since we set up a server and don't have a GUI installed on it, we can safely turn this option off.-
PasswordGuesses 3 The option
PasswordGuessesspecifies how many tries the user has when using password authentication.-
MaxConnections 5 The option
MaxConnectionsspecifies what the maximum number of connections that ssh2 daemon will handle simultaneously is.-
PermitRootLogin no The option
PermitRootLoginspecifies whether root can log in using ssh. Never say,yesto this option.-
AllowedAuthentications publickey,password The option
AllowedAuthenticationsspecifies which authentication methods are allowed to be used. With this option the administrator can force users to complete several authentications before they are considered authenticated.-
RequiredAuthentications publickey,password The option
RequiredAuthenticationsrelated toAllowedAuthentications, specifies which authentication methods the users must complete before continuing. This parameter must be the same as for theAllowedAuthenticationsoption or the server will denies connection every time.-
VerboseMode no The option
VerboseModeinstructs the ssh2 daemon to print debugging messages about its progress. This option is helpful in debugging connection, authentication, and configuration problems.-
PrintMotd yes The option
PrintMotdspecifies whether the ssh2 daemon should print the content of the/etc/motdfile when a user logs in interactively. The/etc/motdfile is also know as the message of the day.-
CheckMail yes The option
CheckMailspecifies whether the ssh2 daemon should print information about new mail you may have.-
UserConfigDirectory "%D/.ssh2" The option
UserConfigDirectoryspecifies the default location for user-specific configuration data.-
SyslogFacility DAEMON The option
SyslogFacilityspecifies the facility code used when logging messages from the ssh2 daemon. The facility specifies the subsystem that produced the message, in our caseDAEMON.-
Ssh1Compatibility no The option
Ssh1Compatibilityspecifies whether or not to use SSH1 compatibility code with SSH2 for ssh1 users.-
NoDelay yes The option
NoDelayspecifies if the socket option TCP_NODELAY should be enabled. It is recommended that you set this option toyesto improve network performance.-
KeepAlive yes The option
KeepAlivespecifies whether the system should send keep alive messages to the remote server. If set toyesthen the death of the connection or crash of remote machines will be properly noticed.-
UserKnownHosts yes The option
UserKnownHostsspecifies whether the default user's home directory$HOME/.ssh2/knownhosts/can be used to get hosts public keys when using hostbased-authentication.-
AllowHosts 192.168.1.4 The option
AllowHostsspecifies and control which hosts can access ssh2 services. Multiple hosts can be specified separated by spaces.-
DenyHosts * The option
DenyHostsspecifies and controls which hosts cannot access ssh2 services. Multiple hosts can be specified separated by spaces. The default pattern*mean all hosts.-
QuietMode no The option
QuietModespecifies whether the system runs in quiet mode. This option must be set tono, because in quiet mode nothing is logged in the system log except for fatal errors. Since we want to have information about user sessions it is preferable to disable this option.