1.开发板,虚拟机,主机 的ping通
第0步:编辑-->虚拟网络编辑器--->恢复网络设置初始化
第1步:虚拟机中:vi /etc/network/interfaces 设置网络ip,网段(开发板,虚拟机, 主机在同一网段),并dhcp(动态)改成static(静态)
设置桥接模式
虚拟机设置-->网络适配器---->桥接模式桥接到有线网卡
编辑-->虚拟网络编辑器
第2步: 虚拟机上网。不同的ubuntu版本中网卡重启的命令不同,在ubuntu10.04中网卡重启使用:/etc/init.d/networking restart 或者 service network restart就可以;但是在ubuntu14.04中这两个都不行了,要重启网卡需要使用:ifdown eth0 然后ifup eth0即可。
ifdown eth0 ifup eth0 重启网卡,ifconfig 查看ip修改是否成功
第3步:主机中:设置网络
第4步: 开发板 uboot的环境变量 修改ip
插上网线,即可ping通
我这遇到的问题:
1.uboot可以ping通虚拟机,ping不通主机。上网查找,发 现关掉主机防火墙,即可
2.虚拟机,主机 ping不通,朱有鹏老师课程里讲到。因为桥接到有线网卡,主机有线网卡没工作,需有网线一头插主机网口,一头插有联网功能的设备(路由器,开发板运行操作系统,另一台电脑)。 即可ping通
2.ssh登陆。(需要上面的环境ping通)
3.第1步:windows中安装sshsecureshell客户端
4.第2步:搭建openssh环境
5. (1)安装ssh-server。(sudo apt-get install openssh-server)如果报错提示依赖错误,可以 参考:http://www.cnblogs.com/mliudong/p/4094519.html
6.如果出现错误:自带的openssh-clien与所要安装的openssh-server所依赖的版本不同, 要安装对应版本的openssh-clien,来覆盖掉ubuntu自带的
sudo apt-get install openssh-client=1:6.6p1-2ubuntu1
提示了系统中openssh-client被降级,这样再安装openssh-server就可以成功了
然后 sudo apt-get install openssh-server
(2)sshsecureshell登录
Ssh登录不上,要修改/etc/ssh/sshd_config,参考: http://blog.sina.com.cn/s/blog_5f435c130102v6pv.html
7.1查看ip地址是否与其他设备冲突
8.2关闭Ubuntu14.04的防火墙
9.3sudo /etc/init.d/ssh restart 启动ssh
10.4如果不行,修改修改/etc/ssh/sshd_config文件.
将其中的PermitRootLogin no修改为yes
PubkeyAuthentication yes修改为no
AuthorizedKeysFile .ssh/authorized_keys前面加上#屏蔽掉,
PasswordAuthentication no修改为yes就可以了。
修改完重启时如果/etc/init.d/ssh restart不起作用,可以使用:ps -e | grep ssh,看sshd的进程号,然后kill -9 进程号杀死ssh进程以达到重启的目的,或者直接重启ubuntu系统
3.虚拟机上网 上面的 sudo apt-get install openssh-client=1:6.6p1-2ubuntu1
sudo apt-get install openssh-server 也需要上网
第1步 vi /etc/network/interfaces 设置网络ip,网段(开发板,虚拟机, 主机在同一网段),并static(静态)改成dhcp(动态)
第2步 桥接能上网的网卡(我的笔记本,无线网卡我选的自动)
第3步 重启网卡