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登录虚拟机。