Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选

首页 / 操作系统 / Linux / Linux命令之ssh - Secure Shell 客户端

用途说明
ssh命令是Linux下常用的远程登录客户端工具,它常用来替代telnet,因为telnet采用明文传输,安全性差,而ssh采用安全传输机制,是远程访问的首选。常用方式
格式:ssh <host>使用SSH远程登录主机<host>,端口为22。用户为当前登录用户。格式:ssh -p <port> <host>格式:ssh <host> -p <port>使用SSH远程登录主机<host>,端口为<port>。用户为当前登录用户。 格式:ssh -l <user> <host>格式:ssh <user>@<host>使用SSH远程登录主机<host>,端口为22。用户为<user>。格式:ssh -p <port> -l <user> <host>格式:ssh -p <port> <user>@<host>使用SSH远程登录主机<host>,端口为<port>。用户为<user>。要注意的是sftp工具的端口指定方式是sftp -oPort=<port> <host>使用sftp访问主机<host>,端口为<port>怎样更改sshd的服务端口?由于OpenSSH也会有安全问题,有时候又不想更新到最新版本,那么常见的提高系统安全性的方法就是修改sshd的服务端口,打开/etc/ssh/sshd_config,找到#Port 22那行,改成别的端口,比如Port 2622。然后重新加载sshd配置,即执行service sshd reload。使用示例
示例一
[root@www.linuxidc.com ~]# ssh 192.168.1.181   
The authenticity of host "192.168.1.181 (192.168.1.181)" can"t be established.
RSA key fingerprint is 5e:bf:a3:bf:a5:40:58:02:ce:00:55:53:50:f8:73:46.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added "192.168.1.181" (RSA) to the list of known hosts.
root@192.168.1.181"s password:
Last login: Sat Mar 26 11:41:14 2011 from cvsbank
[root@linuxidc root]# exit
logoutConnection to 192.168.1.181 closed.
[root@www.linuxidc.com ~]# [root@www.linuxidc.com ~]# ssh 192.168.1.181
root@192.168.1.181"s password:
Last login: Sun Apr 17 11:45:54 2011 from 192.168.1.191
[root@linuxidc root]# exit
logoutConnection to 192.168.1.181 closed.
[root@www.linuxidc.com ~]#示例二
[root@www.linuxidc.com ~]# ssh -p 18622 192.168.1.186
The authenticity of host "192.168.1.186 (192.168.1.186)" can"t be established.
RSA key fingerprint is 70:99:59:b2:f3:55:f9:fd:7d:a8:3b:76:d0:63:f7:32.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added "192.168.1.186" (RSA) to the list of known hosts.
root@192.168.1.186"s password:
[root@web186 root]# exit
logoutConnection to 192.168.1.186 closed.
[root@www.linuxidc.com ~]#Linux命令之stat - 显示文件或文件系统状态Linux命令之sync - 强制将内存中的文件缓冲内容写到磁盘相关资讯      Linux命令 
  • 48 字节命令可令 Linux 系统当机!  (今 07:55)
  • 在Linux笔记本上执行这句命令能致  (02月02日)
  • .NET开发必会的Linux命令  (12/20/2015 10:32:03)
  • 运维工程师必会的109个Linux命令  (03月09日)
  • 有趣的Linux命令行:随机输出唐诗  (12/28/2015 20:14:23)
  • 10 个 Linux 中的 passwd 命令示例  (10/29/2015 10:14:30)
本文评论 查看全部评论 (0)
表情: 姓名: 字数