Managing Secure Shell Access in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

How to Configure Port Forwarding in Secure Shell

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 -  Secure Shell port forwarding must use TCP connections. Secure Shell does not support UDP connections for port forwarding.

Before You Begin

You must assume the root role. For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2 .

  1. Configure a Secure Shell setting on the remote server to allow port forwarding.

    Change the value of AllowTcpForwarding to yes in the /etc/ssh/sshd_config file.

    # Port forwarding
    AllowTcpForwarding yes
  2. Restart the Secure Shell service.
    remoteHost# svcadm restart network/ssh:default

    For information about managing persistent services, see Chapter 1, Introduction to the Service Management Facility, in Managing System Services in Oracle Solaris 11.2 and the svcadm(1M) man page.

  3. Verify that port forwarding can be used.
    remoteHost# /usr/bin/pgrep -lf sshd
    1296 ssh -L 2001:remoteHost:23 remoteHost