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

安装完成以后
设置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了。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值