虚拟机安装完成以后的初始化操作笔记
安装完成以后设置root密码 切换root用户sudo passwdsu root设置vi 命令操作nano /ect/apt/sources.listdeb Index of /ubuntu/ trusty main restricted universe multiversedeb Index of /ubuntu/ trusty-security main restricted
·
安装完成以后
设置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了。
更多推荐
已为社区贡献6条内容
所有评论(0)