Personal tools
You are here: Home Documentation Security Configure your ssh daemon
Views
Document Actions

Configure your ssh daemon

by Troy Dawson last modified 2012-11-15 14:27
History
Action Performed by Date and Time Comment
Publish Troy Dawson 2008-08-28 15:33 No comments.

What you need to configure a modern (openssh 3.9 and above) ssh daemon to only allow kerberos authentication?

Fermilab only allows kerberos authentication to machines on Fermilab's network.
If a machine is found at Fermilab to have an openssh deamon running, and the daemon is allowing regular passwords, your machine will be blocked from the network.
**What can you do to not be blocked?
*Answer 1: Turn sshd off.
*Answer 2: Configure sshd to accept kerberos authentication only, and get a host keberos principle.
This page is designed to help with Answer 2, configuring your sshd to only accept kerberos authentication. Getting a host kerberos principle is discussed on other web pages.

For SLF5 systems, installing the openssh-server from the fermi-base or fermi-security repo should result in having the correct default settings.

For SLF6 systems, you should install zz_fermi_sshd_config which will configure the approprate defaults.


If the above didn't work for you, these instructions below cover SLF4 and older. Much of what is here should still be relevant.

Most all versions of openssh 3.9 and above have kerberos authentication built into them.
This is good.
Most all versions of openssh 3.9 and above have sshd configured to allow password authentication.
This isn't as good for users at Fermilab.

But all you have to do to fix pasword problems is edit sshd_config, usually found at /etc/ssh/sshd_config and change it to look like the following

#	$OpenBSD: sshd_config,v 1.69 2004/05/23 23:59:53 dtucker Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.

#Port 22
#Protocol 2,1
#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 768

# Logging
#obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6

RSAAuthentication no
PubkeyAuthentication no
#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 yes
#PermitEmptyPasswords no
PasswordAuthentication no

# Change to no to disable s/key passwords
ChallengeResponseAuthentication no

# Kerberos options
KerberosAuthentication yes
KerberosOrLocalPasswd no
KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes
GssapiKeyExchange 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 mechanism. 
# Depending on your PAM configuration, this may bypass the setting of 
# PasswordAuthentication, PermitEmptyPasswords, and 
# "PermitRootLogin without-password". If you just want the PAM account and 
# session checks to run without PAM authentication, then enable this but set 
# ChallengeResponseAuthentication=no
#UsePAM no

#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
UsePrivilegeSeparation no
#PermitUserEnvironment no
#Compression yes
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#ShowPatchLevel no

# override default of no subsystems
Subsystem	sftp	/usr/libexec/openssh/sftp-server

Remember, this configures you ssh deamon to do kerberos authentication only. But you still have to have a host based kerberos principle to actually log in. This is only one part out of a two part step. But if you already have host keberos principle, then this is all you need to do.

After changing the sshd_config file, don't forget to restart the daemon.


Powered by Plone, the Open Source Content Management System

This site conforms to the following standards: