感谢支持
我们一直在努力

VMware虚拟机中Ubuntu 11.04系统开启ssh服务的方法

虚拟机系统:
Product  VMware@Workstation
Version  7.1.3 build-324285
虚拟机系统 Ubuntu 11.04
主机系统: Microsoft Windows XP Professional 版本 2002 Service Pack 3
Ubuntu 在北京交通大学镜像下载,速度很快http://mirror.bjtu.edu.cn/ubuntu-releases/
在虚拟机安装好Ubuntu 11.04 之后,首先更新源:
以下是Ubuntu 11.04 教育网的源:


#电子科技大学


deb http://ubuntu.uestc.edu.cn/ubuntu/ natty main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ natty-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ natty-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ natty-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ natty-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ natty main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ natty-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ natty-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ natty-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ natty-updates main restricted universe multiverse


#中国科技大学


deb http://debian.ustc.edu.cn/ubuntu/ natty main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ natty-backports restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ natty-proposed main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ natty-security main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ natty-updates main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ natty main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ natty-backports main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ natty-proposed main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ natty-security main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ natty-updates main restricted universe multiverse


#北京理工大学


deb http://mirror.bjtu.edu.cn/ubuntu/ natty main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ natty-backports main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ natty-proposed main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ natty-security main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ natty-updates main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ natty main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ natty-backports main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ natty-proposed main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ natty-security main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ natty-updates main multiverse restricted universe


#兰州大学


deb ftp://mirror.lzu.edu.cn/ubuntu/ natty main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ natty-backports main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ natty-proposed main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ natty-security main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ natty-updates main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu-cn/ natty main multiverse restricted universe


#上海交通大学


deb http://ftp.sjtu.edu.cn/ubuntu/ natty main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ natty-backports main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ natty-proposed main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ natty-security main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ natty-updates main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu-cn/ natty main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ natty main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ natty-backports main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ natty-proposed main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ natty-security main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ natty-updates main multiverse restricted universe


#网易资源


deb http://mirrors.163.com/ubuntu/ natty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ natty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ natty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ natty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ natty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ natty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ natty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ natty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ natty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ natty-backports main restricted universe multiverse

首先备份自带的源


sudo  cp /etc/apt/sources.list  /etc/apt/sources.list_backup


然后修改源


sudo gedit /etc/apt/sources.list


选择较快的源,替换原来的内容,保存。


更新软件包列表


sudo apt-get update


安装系统更新


依次点击System- Administrator-Update Manger,安装更新,按提示重启。


update 更新软件列表信息,包括版本,依赖关系等 upgrade在不改变现有软件设置的基础上更新软件dist-upgrade会改变配置文件,改变旧的依赖关系  更新版本实际上就是更新软件包,debian采用滚动升级,所以dist-upgrade仅用来升级软件,Ubuntu则用dist-upgrade来版本(版本升级会修改大量配置文件)


安装、配置、开启ssh服务


sudo apt-get install openssh-server


Ubuntu缺省安装了openssh-client,所以在这里就不安装了,如果你的系统没有安装的话,再用apt-get安装上即可。


然后确认sshserver是否启动了:


ps -e |grep ssh


如果只有ssh-agent那ssh-server还没有启动,需要/etc/init.d/ssh start,如果看到sshd那说明ssh-server已经启动了。


ssh-server配置文件位于/ etc/ssh/sshd_config,在这里可以定义SSH的服务端口,默认端口是22,你可以自己定义成其他端口号。为了更安全,建议更改端口,然后重启SSH服务:


sudo /etc/init.d/ssh resart


在windows XP系统中,使用putty.exe登录虚拟机。


VMware虚拟机中Ubuntu 11.04系统开启ssh服务的方法
VMware虚拟机中Ubuntu 11.04系统开启ssh服务的方法

图中虚拟机的ip地址是路由器分配的子网私有地址,如果要使得外网可以登录,则应在路由器端192.168.1.1设置端口映射。

赞(0) 打赏
转载请注明出处:服务器评测 » VMware虚拟机中Ubuntu 11.04系统开启ssh服务的方法
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏