键入 ssh 命令,并指定远程主机名称和您的登录信息。
mySystem% ssh myRemoteHost -l username
此时可能会出现提示,询问远程主机的真实性:
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)?
初始连接到远程主机时,出现此提示为正常情况。
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
Enter passphrase for key '/home/username/.ssh/id_rsa': <Type passphrase>
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%
所发送的命令将会加密。所接收的任何响应都会加密。
完成后,键入 exit 或者使用常规方法退出 shell。
myRemoteHost% exit myRemoteHost% logout Connection to myRemoteHost closed mySystem%
在此示例中,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 &