Skip Navigation Links | |
Exit Print View | |
System Administration Guide: Security Services Oracle Solaris 11 Express 11/10 |
1. Security Services (Overview)
Part II System, File, and Device Security
2. Managing Machine Security (Overview)
3. Controlling Access to Systems (Tasks)
4. Virus Scanning Service (Tasks)
5. Controlling Access to Devices (Tasks)
6. Using the Basic Audit Reporting Tool (Tasks)
7. Controlling Access to Files (Tasks)
Part III Roles, Rights Profiles, and Privileges
8. Using Roles and Privileges (Overview)
9. Using Role-Based Access Control (Tasks)
10. Role-Based Access Control (Reference)
Part IV Oracle Solaris Cryptographic Services
13. Oracle Solaris Cryptographic Framework (Overview)
14. Oracle Solaris Cryptographic Framework (Tasks)
15. Oracle Solaris Key Management Framework
Part V Authentication Services and Secure Communication
16. Using Authentication Services (Tasks)
19. Using Solaris Secure Shell (Tasks)
Solaris Secure Shell (Overview)
Solaris Secure Shell Authentication
Solaris Secure Shell in the Enterprise
Solaris Secure Shell and the OpenSSH Project
Solaris Secure Shell (Task Map)
Configuring Solaris Secure Shell (Task Map)
Configuring Solaris Secure Shell
How to Set Up Host-Based Authentication for Solaris Secure Shell
How to Enable Solaris Secure Shell v1
How to Configure Port Forwarding in Solaris Secure Shell
How to Create User and Host Exceptions to SSH System Defaults
Using Solaris Secure Shell (Task Map)
How to Generate a Public/Private Key Pair for Use With Solaris Secure Shell
How to Change the Passphrase for a Solaris Secure Shell Private Key
How to Log In to a Remote Host With Solaris Secure Shell
How to Reduce Password Prompts in Solaris Secure Shell
How to Use Port Forwarding in Solaris Secure Shell
How to Copy Files With Solaris Secure Shell
How to Set Up Default Connections to Hosts Outside a Firewall
20. Solaris Secure Shell (Reference)
21. Introduction to the Kerberos Service
22. Planning for the Kerberos Service
23. Configuring the Kerberos Service (Tasks)
24. Kerberos Error Messages and Troubleshooting
25. Administering Kerberos Principals and Policies (Tasks)
26. Using Kerberos Applications (Tasks)
27. The Kerberos Service (Reference)
Part VII Oracle Solaris Auditing
28. Oracle Solaris Auditing (Overview)
29. Planning for Oracle Solaris Auditing
30. Managing Oracle Solaris Auditing (Tasks)
By default, host-based authentication and the use of both protocols are not enabled in Solaris Secure Shell. Changing these defaults requires administrative intervention. Also, for port forwarding to work requires administrative intervention.
The following procedure sets up a public key system where the client's public key is used for authentication on the server. The user must also create a public/private key pair.
In the procedure, the terms client and local host refer to the machine where a user types the ssh command. The terms server and remote host refer to the machine that the client is trying to reach.
For more information, see How to Obtain Administrative Rights.
In the client configuration file, /etc/ssh/ssh_config, type the following entry:
HostbasedAuthentication yes
For the syntax of the file, see the ssh_config(4) man page
In the server configuration file, /etc/ssh/sshd_config, type the same entry:
HostbasedAuthentication yes
For the syntax of the file, see the sshd_config(4) man page
For more information, see the FILES section of the sshd(1M) man page.
client-host
client-host
Set IgnoreRhosts to no in the /etc/ssh/sshd_config file.
## sshd_config IgnoreRhosts no
## sshd_config IgnoreUserKnownHosts no
For user instructions, see How to Generate a Public/Private Key Pair for Use With Solaris Secure Shell.
The host keys are stored in the /etc/ssh directory. The keys are typically generated by the sshd daemon on first boot.
On the client, type the command on one line with no backslash.
# cat /etc/ssh/ssh_host_dsa_key.pub | ssh RemoteHost \ 'cat >> /etc/ssh/ssh_known_hosts && echo "Host key copied"'
When the file is copied, the message “Host key copied” is displayed.
Each line in the /etc/ssh/ssh_known_hosts file consists of fields that are separated by spaces:
hostnames algorithm-name publickey comment
## /etc/ssh/ssh_known_hosts File RemoteHost <copied entry>
Example 19-1 Setting Up Host-based Authentication
In the following example, each host is configured as a server and as a client. A user on either host can initiate an ssh connection to the other host. The following configuration makes each host a server and a client:
On each host, the Solaris Secure Shell configuration files contain the following entries:
## /etc/ssh/ssh_config HostBasedAuthentication yes # ## /etc/ssh/sshd_config HostBasedAuthentication yes IgnoreRhosts no
On each host, the shosts.equiv file contains an entry for the other host:
## /etc/ssh/shosts.equiv on machine2 machine1
## /etc/ssh/shosts.equiv on machine1 machine2
The public key for each host is in the /etc/ssh/ssh_known_hosts file on the other host:
## /etc/ssh/ssh_known_hosts on machine2 … machine1
## /etc/ssh/ssh_known_hosts on machine1 … machine2
Users have an account on both hosts:
## /etc/passwd on machine1 jdoe:x:3111:10:J Doe:/home/jdoe:/bin/sh
## /etc/passwd on machine2 jdoe:x:3111:10:J Doe:/home/jdoe:/bin/sh
This procedure is useful when a host interoperates with hosts that run v1 and v2.
For more information, see How to Obtain Administrative Rights.
Edit the /etc/ssh/sshd_config file.
# Protocol 2 Protocol 2,1
Add a HostKey entry to the /etc/ssh/sshd_config file.
HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_dsa_key HostKey /etc/ssh/ssh_host_rsa1_key
# ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_rsa1_key -N ''
Indicates the RSA algorithm for v1.
Indicates the file that holds the host key.
Indicates that no passphrase is required.
# svcadm restart network/ssh:default
You can also reboot the system.
Port forwarding enables a local port be forwarded to a remote host. Effectively, a socket is allocated to listen to the port on the local side. Similarly, a port can be specified on the remote side.
Note - Solaris Secure Shell port forwarding must use TCP connections. Solaris Secure Shell does not support UDP connections for port forwarding.
For more information, see How to Obtain Administrative Rights.
Change the value of AllowTcpForwarding to yes in the /etc/ssh/sshd_config file.
# Port forwarding AllowTcpForwarding yes
remoteHost# svcadm restart network/ssh:default
For information on managing persistent services, see Chapter 18, Managing Services (Overview), in System Administration Guide: Basic Administration and the svcadm(1M) man page.
remoteHost# /usr/bin/pgrep -lf sshd 1296 ssh -L 2001:remoteHost:23 remoteHost
This procedure adds a conditional Match block after the global section of the /etc/ssh/sshd_config file. Keyword-value pairs that follow the Match block specify exceptions for the user, group, host, or address that is specified as the match.
For more information, see How to Obtain Administrative Rights.
Place the Match blocks after the global settings.
Note - The global section of the file might or might not list the default settings. For the defaults, see the sshd_config(4) man page.
You might have users who should not be allowed to use TCP forwarding. In the following example, any user in the group public, and any user name that begins with test cannot use TCP forwarding:
## sshd_config file ## Global settings # Example (reflects default settings): # # Host * # ForwardAgent no # ForwardX11 no # PubkeyAuthentication yes # PasswordAuthentication yes # FallBackToRsh no # UseRsh no # BatchMode no # CheckHostIP yes # StrictHostKeyChecking ask # EscapeChar ~ Match Group public AllowTcpForwarding no Match User test* AllowTcpForwarding no
For information about the syntax of the Match block, see the sshd_config(4) man page.