您的位置:首页 > 其它

虚拟机安装完成以后的初始化操作笔记

2017-04-15 23:42 295 查看
安装完成以后
设置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了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐