安装完成以后
设置root密码 切换root用户
sudo passwd
su root
设置vi 命令操作
nano /ect/apt/sources.list
deb Index of /ubuntu/ trusty main restricted universe multiverse
deb Index of /ubuntu/ trusty-security main restricted universe multiverse
deb Index of /ubuntu/ trusty-updates main restricted universe multiverse
deb Index of /ubuntu/ trusty-proposed main restricted universe multiverse
deb Index of /ubuntu/ trusty-backports main restricted universe multiverse
deb-src Index of /ubuntu/ trusty main restricted universe multiverse
deb-src Index of /ubuntu/ trusty-security main restricted universe multiverse
deb-src Index of /ubuntu/ trusty-updates main restricted universe multiverse
deb-src Index of /ubuntu/ trusty-proposed main restricted universe multiverse
deb-src Index of /ubuntu/ trusty-backports main restricted universe multiverse

sudo apt-get install vim
alias vi=vim


Linux下用ifconfig命令设置IP、掩码、网关 
设置IP和掩码
ifconfig eth0 192.168.5.40 netmask 255.255.255.0
设置网关
route add default gw 192.168.5.1

查看ip
ifconfig

连接SSH服务
apt-get install openssh-server
查看服务是否启动
ps -ef | grep sshd
否则
 /etc/init.d/ssh start
 在开启root账号以后,在主机上用root用户来连接该ubuntu,发现无法连接。
 查了一下,发现是sshd服务默认不支持root用户远程连接,
 因此我们需要修改sshd的配置文件/etc/ssh/sshd_config,
 将PermitRootLogin由默认的without-password改为yes,
 然后用sudo service ssh restart或者sudo /etc/init.d/ssh restart来重新启动sshd服务。
 这样我们就可以通过root用户来ssh远程登陆虚拟机内的ubuntu了。
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐