Home > Articles > Operating Systems, Server > Solaris

Like this article? We recommend


OpenSSH offers a number of features to protect network connections between two hosts. There are choices of protocol, authentication method, port forwarding, user access, and network access. When setting up OpenSSH, you will have to make trade offs between security, ease of use, and legacy compatibility. The choices you make depend on local security policy.

Protocol Support

There are two major versions of the secure shell protocol: SSH1 and SSH2. SSH1 was the first protocol developed and has been replaced with SSH2. It is highly recommended that you disable the use of SSH1 since the protocol has been found to have several vulnerabilities including packet insertion attacks and password length determination. In sshd_config and ssh_config, set Protocol to 2, as follows.

# Protocol 2 only is recommended.
 Protocol 2

For legacy client and server support, allow SSH1 but set the default to SSH2, as follows.

# Enable legacy support but default is Protocol 2.
Protocol 2,1

Unfortunately, many legacy clients and servers only support SSH1. Consider upgrading legacy clients and servers to those that support SSH2. If you wish to audit installed base of ssh servers, consider using scanssh by Niels Provos. It is designed to scan a network and report the version strings of any ssh servers found. (You can also use ssh-keyscan and shell scripting to accomplish the same thing in a much less efficient manner.)

Network Access

By default, the OpenSSH server daemon listens to all network interfaces. For workstations and other systems where accessibility is desired on all interfaces, this is not a problem. For architectures where a single interface is dedicated to management or administration, it is preferable not to expose OpenSSH to the other networks. Limit network access with ListenAddress in sshd_config as shown here.

# Listen only on management network

To further narrow down what the server will listen to (for example, a specific address range or single host), use either a host-based firewall or a tool like tcpwrappers.


OpenSSH does support the use of TCP wrappers but support needs to be compiled into the server. Consult the build documentation of OpenSSH for information.

Connection Forwarding

OpenSSH can create a secure tunnel to provide some protection for insecure protocols. This is referred to as connection forwarding and only works for TCP-based connections. During connection forwarding, a local TCP port is opened and OpenSSH waits for a connection. When OpenSSH receives a connection, it forwards the data to the OpenSSH server on the other end. The server then sends the data to its final destination. Responses follow the same process, in reverse.


Data is protected only until it reaches the OpenSSH server. After that, it is handled the same as normal network traffic.

Connection forwarding is useful for protecting commonly used, noncryptographic protocols like IMAP, which is used for email. It can also be used to provide remote users with access to internal resources such as news, email, and web access. If policy is such that remote users are to be granted access to these resources, enable connection forwarding.

There are two caveats with connection forwarding. Firstly, connection forwarding is an all or nothing mechanism. Once forwarding is allowed, the client can forward any port to any location on the remote side. If this is an issue, consider using host-based firewalls on the OpenSSH server to limit connections. Secondly, because traffic that travels through connection forwarding is encrypted, neither a firewall, nor an intrusion detection system can detect when abnormal events occur. The OpenSSH server on the remote side is traffic agnostic. It does not know if data coming out is a normal IMAP request for a message or if it is buffer overflow exploit against the IMAP server. Plan firewall and intrusion detection sensors accordingly. Add the following to sshd_config to allow TCP forwarding.

# Server configuration
AllowTCPForwarding yes

An example of a client forwarding in ssh_config.

# client configuration
# Allow remote users access to an internal web server.
LocalForward 8080 http://www.corp.acme.com:80

Gateway Ports

Gateway ports work in conjunction with connection forwarding. Normally, connection forwarding allows only the local host to send data to the other side of a connection. By using a gateway port, you enable other machines to connect and forward data. In effect, gateway ports create a tunnel from one network to another network. This is highly risky and in general should always be disabled. For example, an user sitting in an airport connected over a 802.11b wireless link with gateway ports turned on and a local forward to an internal web server would allow everyone in the immediate vicinity access to the web server. Set the following in both sshd_config and ssh_config.

# Server and client configuration
GatewayPorts no

X Forwarding

OpenSSH can also securely tunnel X traffic. Because the X protocol travels in the clear, it is vulnerable to sniffing and hijacking. OpenSSH emulates an X server on the remote side and passes traffic back through the tunnel to the local client. In addition to its usefulness for remote users, this can also help decrease the potential for users to use xhost + to disable all access controls. Add the following lines to both sshd_config and ssh_config.

# Server and client configuration
X11Forwarding yes

The following is an example of the values of $DISPLAY on a local host and over an X forwarded tunnel.

host $ echo $DISPLAY
host $ ssh remotehost
user@remotehost's password:XXXXXXXX
remotehost $ echo $DISPLAY

User Access

Some sites require that a banner be displayed once users connect to a system, but before they log in. If this is required, set the banner to /etc/issue in sshd_config, as shown in the following example, so only one banner exists for the whole system.

Banner /etc/issue

The default login grace time is ten minutes. This value is too high. Consider reducing it in the sshd_config to thirty or sixty seconds as shown here.

LoginGraceTime 60

User access control lists can be specified in OpenSSH; however, no part of the Solaris OE honors this access control list (ACL). The two available options are to allow only specified users access, or to specifically deny a user access. The default is to allow anyone access. You can also specify access with group membership. Note that the groups options only apply to the primary group (the group listed in /etc/passwd). An example of both allow and deny ACLs in sshd_config appears as follows.

# Allow sysadmin staff
AllowGroups staff

# Or limit a particular user's access off a machine
DenyUsers kaw alex

By default, the root user can log in using OpenSSH. This is fine for systems without user accounts. However, disabling root logins and requiring administrators to use su to root is more secure and leaves an audit trail. If you have remote jobs that run as root, you can configure OpenSSH to only execute scripts. This requires the use of two-factor (key-based) authentication. If root logins are required at your site, only use key-based authentication as discussed later in this article. To set this up, add the following to sshd_config.

# Only add one of these settings.
# Forces sysadmins to su.
PermitRootLogin no
# If remote jobs require root priviledges.
PermitRootLogin forced-commands-only


OpenSSH supports multiple forms of authentication: the traditional login and password, two- factor (public-key-based), and host-based. Each method has different benefits. Password authentication fits well in existing structures. Two-factor authentication offers improved security, although with higher maintenance costs. Host-based authentication provides the most convenience, although it is extremely unsafe and easily abused.

Password authentication is the most common way for systems to authenticate users. The drawback to this method is that passwords can be shoulder-surfed, guessed with dictionaries, and sniffed in transit across the network. While OpenSSH protects passwords by encrypting them, this only prevents sniffing while they are in transit, and can't do anything to minimize the effects of other threats. To counter other threats, OpenSSH provides two-factor or key- based authentication.

Key-based authentication is a challenge and response system which is grounded in the mathematics of public-key cryptography. There are essentially two elements: a public key that resides on all servers the user will access, and a private key that only the user knows. The private key is additionally protected by a passphrase. This system is more secure than passwords alone because in addition to being based on a passphrase the user knows, it is also based on something the user has in their possession, the private key.

The system works roughly as follows. OpenSSH generates a key pair, stores the public key on the OpenSSH server, and leaves an encrypted version of the private key on the user's machine with a passphrase. When the user connects to the server, OpenSSH prompts the user for a passphrase to decrypt the private key. The OpenSSH client and server then go through a challenge and response to prove that the two keys are related. If the server agrees that user really does have the private key, it grants the user access. The private key is never stored on the server or transmitted to it, and the public key is useless without the private key, and vice versa. For a system to be subverted (leaving out program flaws like bugs), someone would have to acquire a copy of the private key and the passphrase.

Because private keys are often stored on NFS home directories, good passphrases are critical to the success of this approach. Examples of bad phrases might include simple sentences with no punctuation and no capitalization, or extremely common phrases like "to be or not to be." Examples of good phrases include phrases or words the user can easily remember and won't write down. If a user looses a passphrase, you will need to generate a new key pair, as a passphrase cannot be recovered. Further, passphrases tend to be resistant to shoulder surfing due to their length.

Host-based authentication trusts a connection based on where it comes from. This is very unsafe and easily abused. Rlogin and rsh also use this method of authentication as denoted by their dependence on .rhosts files.

It is recommended that sites disable any semblance of host-based authentication. Sites that support a large number of internal users should consider staying with passwords to reduce training costs. Sites with remote users and sites that need to automate jobs should consider using key-based authentication. Add the following to sshd_config for the preceding recommendations.

# Disable unsafe hosts based authentication
HostbasedAuthentication no
RhostsAuthentication no
IgnoreRhosts yes
# Empty passwords are trivial to guess
PermitEmptyPasswords no
# For internal servers, passwords ok. Bastion hosts - no.
PasswordAuthentication yes
# For remote access, automated jobs, and advanced users
PubkeyAuthentication yes

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020