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 &
-
Host *
-
# ForwardAgent no
-
# ForwardX11 no
-
# ForwardX11Trusted yes
-
# RhostsRSAAuthentication no
-
# RSAAuthentication yes
-
# PasswordAuthentication yes
-
# HostbasedAuthentication no
-
# GSSAPIAuthentication no
-
# GSSAPIDelegateCredentials no
-
# GSSAPIKeyExchange no
-
# GSSAPITrustDNS no
-
# BatchMode no
-
# CheckHostIP yes
-
# AddressFamily any
-
# ConnectTimeout 0
-
# StrictHostKeyChecking ask
-
# IdentityFile ~/.ssh/identity
-
# IdentityFile ~/.ssh/id_rsa
-
# IdentityFile ~/.ssh/id_dsa
-
Port 22
-
# Protocol 2,1
-
# Cipher 3des
-
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
-
# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
-
# EscapeChar ~
-
# Tunnel no
-
# TunnelDevice any:any
-
# PermitLocalCommand no
-
# VisualHostKey no
-
# ProxyCommand ssh -q -W %h:%p gateway.example.com
-
# RekeyLimit 1G 1h
-
SendEnv LANG LC_*
-
HashKnownHosts yes
-
GSSAPIAuthentication yes
-
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之间的文件传送:
阅读(2639) | 评论(0) | 转发(0) |