You are not logged in.
I'm setting up a webserver for a friend and it will be exposed to the 'net at large. I'd like to have some of the experts in here review the /etc/ssh/sshd_config I'm planning to use and please provide comment/suggestions.
Thanks!
Port 56190
#AddressFamily any
ListenAddress 0.0.0.0
#ListenAddress ::
#HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
#HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
#Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024
#Logging
#obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
LogLevel VERBOSE
#Authentication:
LoginGraceTime 1m
PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
#PermitEmptyPasswords no
# Change to no to disable s/key passwords
ChallengeResponseAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM yes
AllowAgentForwarding yes
AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
PermitTunnel yes
#ChrootDirectory none
# no default banner path
#Banner none
# override default of no subsystems
Subsystem sftp /usr/lib/ssh/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# ForceCommand cvs server
Last edited by graysky (2010-09-27 21:36:34)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
I'm not an expert but here goes a thought, make sure you test that root login is really disallowed. Some UsePAM and ChallengeResponseAuthentication combinations will still allow root login even when saying "PermitRootLogin no", it shouldn't be much of a problem though because password authentication is disabled but still better double check (which you probably already did by now).
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
Why have you commented out MaxAuthTries? I would have thought that keeping this to a relatively small number, eg., 3, would be a good idea...
Offline
@R - With password auth disabled, you don't get a chance to try if you lack one of the known keys EDIT: Have a look at the "update" and "update II" sections of this article which gets at what you mentioned I think.
@j - Good point, I changed it to 3.
Last edited by graysky (2010-09-27 23:27:17)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
don't forget the "AllowUsers name ", just in case... ; )
There are no foreign lands. It is the traveler only who is foreign. --R.L Stevenson
Offline
Nice, thanks ga. That's tip #8 in this article.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
I just mentioned that about PAM because one opensuse machine left me banging my head against the keyboard for a while trying to disable root login and I traced it back to the settings I mentioned earlier, so if it overrides the no root login directive it might also still provide password authentication (and testing it takes less that a minute anyway), but like I said, I'm not an expert.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline