`

Putty远程登录VMware虚拟机Linux(Ubuntu)

 
阅读更多
http://www.linuxidc.com/Linux/2011-10/45523.htm

安装SSH服务

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

www.linuxidc.com@linuxidc:~$ ssh localhost   
ssh: connect to host localhost port 22: Connection refused   
如上所示,表示没有还没有安装,可以通过apt安装,命令如下:

www.linuxidc.com@linuxidc:~$ sudo apt-get install openssh-server   
系统将自动进行安装,安装完成以后,先启动服务:

www.linuxidc.com@linuxidc:~$ sudo /etc/init.d/ssh start   
启动后,可以通过如下命令查看服务是否正确启动

www.linuxidc.com@linuxidc:~$ ps -e|grep ssh   
6212 ?        00:00:00 sshd   
如上表示启动ok。注意,ssh默认的端口是22,可以更改端口,更改后先stop,
然后start就可以了。改配置在/etc/ssh/sshd_config下,如下所示。

www.linuxidc.com@linuxidc:~$ vi /etc/ssh/sshd_config   
# Package generated configuration file   
# See the sshd(8) manpage for details   
# What ports, IPs and protocols we listen for   
Port 22   
最后,应该是连接的时候了。请看如下命令:

www.linuxidc.com@linuxidc:~$ ssh exceljava@192.168.158.129   
断开连接:
exit 
通过Putty登陆虚拟机

首先要保证虚拟机和主机之间可以互相ping通,如果不能ping通则后续工作无法进行。可以在网上搜索有关虚拟机IP配置的文章参考

其次,打开Putty客户端,出现以下界面,填入相关参数:



其中IP地址为虚拟机中Ubuntu的IP地址。
最后点击Open进入Putty,输入用户名和密码即可登陆。



解决中文乱码问题

登陆以后,使用ls命令查看当前用户根目录,出现乱码



花下眠工作室: http://huaxiamian.cc
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics