在 Oracle® Solaris 11.2 中管理安全 Shell 访问

退出打印视图

更新时间: 2014 年 9 月
 
 

如何使用安全 Shell 登录到远程主机

  1. 启动安全 Shell 会话。

    键入 ssh 命令,并指定远程主机名称和您的登录信息。

    mySystem% ssh myRemoteHost -l username
  2. 如果出现提示,请检验远程主机密钥的真实性。

    此时可能会出现提示,询问远程主机的真实性:

    The authenticity of host 'myRemoteHost' can't be established.
    RSA key fingerprint in md5 is: 04:9f:bd:fc:3d:3e:d2:e7:49:fd:6e:18:4f:9c:26
    Are you sure you want to continue connecting(yes/no)? 

    初始连接到远程主机时,出现此提示为正常情况。

    • 如果无法确认远程主机的真实性,请键入 no 并与系统管理员联系。
      Are you sure you want to continue connecting(yes/no)? no

      管理员负责更新全局 /etc/ssh/ssh_known_hosts 文件。更新后的 ssh_known_hosts 文件可禁止出现此提示。

    • 如果确认了远程主机的真实性,请回答提示,并继续下一步。
      Are you sure you want to continue connecting(yes/no)? yes
  3. 向安全 Shell 验证自身的身份。
    1. 出现提示时,键入口令短语。
      Enter passphrase for key '/home/username/.ssh/id_rsa': <Type passphrase>
    2. 出现提示时,键入帐户口令。
      username@myRemoteHost's password: <Type password>
      Last login: Wed Sep  7 09:07:49 2011 from myLocalHost
      Oracle Corporation      SunOS 5.11       September 2011
      myRemoteHost%
  4. 执行远程主机上的事务。

    所发送的命令将会加密。所接收的任何响应都会加密。

  5. 关闭安全 Shell 连接。

    完成后,键入 exit 或者使用常规方法退出 shell。

    myRemoteHost% exit
    myRemoteHost% logout
    Connection to myRemoteHost closed
    mySystem%
示例 1-2  在安全 Shell 中显示远程 GUI

在此示例中,jdoe 在两个系统上都是初始用户,并且指定有 Software Installation 权限配置文件。jdoe 想要使用远程系统上的软件包管理器 GUI。X11Forwarding 关键字的缺省值仍然是 yes,并且 xauth 软件包安装在远程系统上。

% ssh -l jdoe -X myRemoteHost
jdoe@myRemoteHost's password: password
Last login: Wed Sep  7 09:07:49 2011 from myLocalHost
Oracle Corporation      SunOS 5.11       September 2011
myRemoteHost% packagemanager &