Chinaunix首页 | 论坛 | 博客
  • 博客访问: 16285
  • 博文数量: 3
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 25
  • 用 户 组: 普通用户
  • 注册时间: 2015-06-24 12:11
文章分类
文章存档

2015年(3)

我的朋友

分类: 嵌入式

2015-06-24 14:23:10

ubuntu默认并没有安装ssh服务,如果通过ssh链接ubuntu,需要自己手动安装ssh-server。
判断是否安装ssh服务,可以通过如下命令进行:

ssh localhost    
ssh: connect to host localhost port 22: Connection refused 
//如果出现该行所示,表示没有还没有安装,可以通过apt安装,命令如下:
系统将自动进行安装,安装完成以后,先启动服务。
具体步骤如下:
sudo apt-get install openssh-server
sudo /etc/init.d/ssh restart
ps -e|grep "ssh"    //如果没有出现端口号等信息,则代表没有启动成功,配置22端口,然后重启。
sudo emacs /etc/ssh/ssh_config &

点击(此处)折叠或打开

  1. Host *
  2. # ForwardAgent no
  3. # ForwardX11 no
  4. # ForwardX11Trusted yes
  5. # RhostsRSAAuthentication no
  6. # RSAAuthentication yes
  7. # PasswordAuthentication yes
  8. # HostbasedAuthentication no
  9. # GSSAPIAuthentication no
  10. # GSSAPIDelegateCredentials no
  11. # GSSAPIKeyExchange no
  12. # GSSAPITrustDNS no
  13. # BatchMode no
  14. # CheckHostIP yes
  15. # AddressFamily any
  16. # ConnectTimeout 0
  17. # StrictHostKeyChecking ask
  18. # IdentityFile ~/.ssh/identity
  19. # IdentityFile ~/.ssh/id_rsa
  20. # IdentityFile ~/.ssh/id_dsa
  21.    Port 22
  22. # Protocol 2,1
  23. # Cipher 3des
  24. # Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
  25. # MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
  26. # EscapeChar ~
  27. # Tunnel no
  28. # TunnelDevice any:any
  29. # PermitLocalCommand no
  30. # VisualHostKey no
  31. # ProxyCommand ssh -q -W %h:%p gateway.example.com
  32. # RekeyLimit 1G 1h
  33.     SendEnv LANG LC_*
  34.     HashKnownHosts yes
  35.     GSSAPIAuthentication yes
  36.     GSSAPIDelegateCredentials no
 sudo reboot
ps -e | grep ssh
//执行后,应该显示类似信息:
  880 ?        00:00:00 sshd
 2485 ?        00:00:00 sshd
 2521 ?        00:00:00 sshd


下面就可以用putty远程登录自己的ubuntu,或者用Secure File Transfer Client来实现windows和ubuntu之间的文件传送:

阅读(2608) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~