在服务器 或者 虚拟机中, 我们查看代码是不方便的,可以使用samba 和 source insight 分别来 同步代码 和 编辑代码
samba 安装
1.1 apt-get 安装
A.安装samba
sudo apt-get install samba
B.配置samba
sudo vim /etc/samba/smb.conf
C.共享目录权限设置
sudo chmod 777 /home/yue/practice -Rf
R:递归
D.重启samba
sudo service smbd restart
E.如果重启后依然连接不了
sudo apt-get install –reinstall libsmbclient libsmbclient-dev libtevent0 libtalloc2
sudo service smbd restart
3)测试
Windows我的电脑中输入\192.168.43.200(虚拟机地址)
4)映射
打开 \192.168.43.200/yue_win右击映射。。 自动生成一个盘
; yum 安装 samba
[root@localhost]
说明:-y的意思是,在安装过程中的所有提问都填”yes”
*扩展:yum的其他命令
[root@localhost]
[root@localhost]
[root@localhost]
[root@localhost]
配置samba的配置文件,用vim 打开smb.conf
vim /etc/samba/smb.conf
在文件里面找到homes, 在后面添加
[lchy]
comment = this is linux share directory
path = /home/lchy
public = yes
browseable = yes
guest ok = yes
writable = yes
create mask = 0777
valid users = root
write list = root
sync always = yes
available = yes
可以参考
[heijunma]
comment = heijunma guest share
path = /home/heijunma
public = yes
writable = yes
directory mask = 0775
create mask = 0775
valid users = heijunma,root
write list = heijunma,root
browseable = yes
available = yes
编辑好之后保存,然后运行如下命令重新加载smb.conf,并重启samba
[root@localhost heijunma]
Reloading smb.conf file: [ OK ]
[root@localhost heijunma]
Shutting down SMB services: [ OK ]
Starting SMB services: [ OK ]
[root@localhost heijunma]
Shutting down NMB services: [ OK ]
Starting NMB services: [ OK ]
接着关闭防火墙SElinux,这种关闭重启Linux后又会开启
[root@localhost heijunma]
[root@localhost heijunma]
[root@localhost heijunma]
查看ip
ifconfig 可以查看 Ubuntu 的 IP 信息,IP 地址为 192.168.1.29。
[root@localhost heijunma]
New SMB password:
Retype new SMB password:
Added user heijunma.
然后重新导入,重启服务
[root@localhost heijunma]
Reloading smb.conf file: [ OK ]
[root@localhost heijunma]
Shutting down SMB services: [ OK ]
Starting SMB services: [ OK ]
[root@localhost heijunma]
Shutting down NMB services: [ OK ]
Starting NMB services: [ OK ]
source insight 查看代码
查看远程的 代码, 代码放在服务器上 ,把c_linux_lchy 的代码用 source insight 来查看
在这里插入图片描述
可以查看代码了,R代表的是搜索
如果source insight 显示中文 乱码的话,进行下面操作
参考:
I.MX6U嵌入式Linux驱动开发指南V1.5.pdf 》》》》 4.4.2 Source Insight 新建工程
samba 安装
https://blog.csdn.net/weixin_40806910/article/details/81917077
Original: https://blog.csdn.net/qq_40787630/article/details/127822190
Author: qq_40787630
Title: 在服务器 和 虚拟机中 查看代码 samba source insight
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/659098/
转载文章受原作者版权保护。转载请注明原作者出处!