Technical article 127604

Configuration changes used in /etc/default/login are not used by SSH

OpenServer 6.0.0OpenServer 5.0.7UnixWare 7.1.4

Written · Last revised

Problem

SSH connections to SCO Unix ignore paramters in /etc/default/login. and using the "UseLogin" option in /etc/ssh/sshd_config you see the following after you have successfully entered the correct password:

UX:login: ERROR: You must exec "login" from the lowest level "sh".

How can I make my SSH configuration more secure?

Solution

This issue has been reported to Engineering.

The "login" process is configured by /etc/default/login.

OpenSSH is configured with /etc/ssh/sshd_config

However, locked accounts will not be allowed access.

To Unlock an account, use "scoadmin account" and unlock the account and reset the password.

Failed ssh connections will appear in the /usr/adm/syslog as:

Jan 28 09:46:34 myserver sshd[26999]: Failed password for user from IP Addr port 3382 ssh2

Information on configuring OpenSSH can be found at:

http://www.openssh.org/manual.html

However, to secure your OpenSSH configuration more, use the following configuration suggestions:

# cd /etc/ssh
# cp sshd_config sshd_config.orig
# vi sshd_config
and change the following options:
# Optional to prevent any bruteforce attack on the root login
PermitRootLogin no
# Optional to prevent user's logging in with null passwords.
# It is recommended to use 'keys' if using secure copies with 'scp'.
PermitEmptyPasswords no
# Change the Port Number used  which sshd listens for connections from the
# default of 22 by picking any 4 or 5 digit number. The highest acceptable
# value is 49151.
Port 8383
# This option signifies how long the server waits before automatically
# regenerating its key. This is a security measure to prevent decrypting
# captured sessions
KeyRegenerationInterval 1h
# This will check user permissions in home directory and rhosts file before
# login. This option must be set to yes because sometime user might leave
# their directory writable for everyone.
StrictModes yes
# AllowUsers only allow a list of users that can ssh into your server
AllowUsers myuser
# Users need to be successfully log in within 1 minute.
LoginGraceTime 1m
# For each connection, users can only try x times, after the second fails,
# all other fails are logged
MaxAuthTries 1
# Disable any port forwarding or X forwarding
AllowTcpForwarding no
X11Forwarding no
# The option IgnoreUserKnownHosts specifies whether the ssh daemon should
# ignore the user's $HOME/.ssh/known_hosts during RhostsRSAAuthentication.
IgnoreUserKnownHosts yes
# The option IgnoreRhosts specifies whether rhosts or shosts files should not
# be used in authentication. For security reasons it is recommended to no use
# rhosts or shosts files for authentication.
IgnoreRhosts yes
# The option LoginGraceTime specifies how long in seconds after a connection
# request the server will wait before disconnecting if the user has not
# successfully logged in.
LoginGraceTime 600
# The option PrintMotd specifies whether the ssh daemon should print the
# contents of the /etc/motd file when a user logs in interactively. The
# /etc/motd file is also known as the message of the day.
PrintMotd yes
# This keyword can be followed by a list of user name patterns, separated by
# spaces.  Other options include DenyUsers and Allow/DenyGroups
AllowUsers x y
# Additional Logging can be seen in /usr/adm/syslog
LogLevel DEBUG

You may wish to restrict the ListenAddress and Protocols used along with investigating the other possible changes you could make to the standard sshd_config file.

To restart OpenSSH with the new configuration changes run:

# /etc/init.d/opensshd restart

Please note that the Banner option does not appear to function for Protocol 2 entry ssh clients.

See also

sshd_config

From the Xinuos technical article database, record 127604. Reproduced with permission. The original is at www.sco.com/ta/127604, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.