• 在服务器 和 虚拟机中 查看代码 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
    
    • 1

    说明:-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软件包
    
    • 1
    • 2
    • 3
    • 4

    配置samba的配置文件,用vim 打开smb.conf

    vim /etc/samba/smb.conf
    
    • 1

    在文件里面找到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
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13

    可以参考

    [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              #该指定共享资源可使用
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12

    编辑好之后保存,然后运行如下命令重新加载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  ]
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

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

    [root@localhost heijunma]#service iptables stop
    [root@localhost heijunma]#setenforce 0
    [root@localhost heijunma]#ufw disable
    
    • 1
    • 2
    • 3

    查看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.
    
    • 1
    • 2
    • 3
    • 4

    然后重新导入,重启服务

    [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  ]
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    在这里插入图片描述

    在这里插入图片描述

    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

  • 相关阅读:
    MySQL主从搭建
    BGP联邦实验详解 超级超级超级超级超级详细!附有源码自取~
    关于配置webpack eslint插件版本问题说明
    ByteHouse实时导入技术演进
    nodejs+vue+elementui电影在线播放交流网站express
    candence画环形贴片焊盘
    MySQ 学习笔记
    Cesium从已知的自定义材质扩展其他效果(二)
    nacos流程总结
    echarts实现中国地图各省背景根据数值大小变化的方法
  • 原文地址:https://blog.csdn.net/qq_40787630/article/details/127822190