在服务器 和 虚拟机中 查看代码 samba source insight

在服务器 或者 虚拟机中, 我们查看代码是不方便的,可以使用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]# yum install samba -y

说明:-y的意思是,在安装过程中的所有提问都填“yes”
*扩展:yum的其他命令

[root@localhost]#yum list samba            //列出软件包的信息
[root@localhost]#yum remove samba          //卸载软件包
[root@localhost]#yum check-update samba    //检查是否有可更新的软件包
[root@localhost]#yum update samba          //更新samba软件包

配置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                #允许guest用户访问
        writable = yes              #允许在heijunma目录下写入
        directory mask = 0775       #默认创建目录权限 rwxrwxr_x
        create mask = 0775          #默认创建文件权限 rwxrwxr_x
        valid users = heijunma,root  #允许访问该共享的用户
        write list = heijunma,root  #可写入共享的用户列表
        browseable = yes             #该指定共享目录可浏览
        available = yes              #该指定共享资源可使用

编辑好之后保存,然后运行如下命令重新加载smb.conf,并重启samba

[root@localhost heijunma]#service smb reload
Reloading smb.conf file:                                   [  OK  ]

[root@localhost heijunma]#service smb restart
Shutting down SMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]

[root@localhost heijunma]#service nmb restart
Shutting down NMB services:                                [  OK  ]
Starting NMB services:                                     [  OK  ]

接着关闭防火墙SElinux,这种关闭重启Linux后又会开启

[root@localhost heijunma]#service iptables stop
[root@localhost heijunma]#setenforce 0
[root@localhost heijunma]#ufw disable

查看ip
ifconfig 可以查看 Ubuntu 的 IP 信息,IP 地址为 192.168.1.29。
在这里插入图片描述

在这里插入图片描述

[root@localhost heijunma]# smbpasswd -a heijunma
New SMB password:
Retype new SMB password:
Added user heijunma.

然后重新导入,重启服务

[root@localhost heijunma]#service smb reload
Reloading smb.conf file:                                   [  OK  ]

[root@localhost heijunma]#service smb restart
Shutting down SMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]

[root@localhost heijunma]#service nmb restart
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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值