zoukankan      html  css  js  c++  java
  • windows下使用samba访问ubuntu目录

    首先使用apt-get安装samba和cifs-utils,装好以后修改/etc/samba/smb.conf文件,在文件末尾增加共享目录相关配置:

    [include]
    comment = linux header
    path = /usr/include
    guest ok = yes

    修改完成后,使用testparm测试配置结果:

    tony@ubuntu-a:~$ testparm
    Load smb config files from /etc/samba/smb.conf
    rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
    Processing section "[printers]"
    Processing section "[print$]"
    Processing section "[include]"
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    Press enter to see a dump of your service definitions
     
    [global]
        server string = %h server (Samba, Ubuntu)
        map to guest = Bad User
        obey pam restrictions = Yes
        pam password change = Yes
        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        unix password sync = Yes
        syslog = 0
        log file = /var/log/samba/log.%m
        max log size = 1000
        dns proxy = No
        usershare allow guests = Yes
        panic action = /usr/share/samba/panic-action %d
        idmap config * : backend = tdb
    
    [printers]
        comment = All Printers
        path = /var/spool/samba
        create mask = 0700
        printable = Yes
        print ok = Yes
        browseable = No
    
    [print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers
    
    [include]
        comment = linux header
        path = /usr/include
        guest ok = Yes

    重启samba:

    tony@ubuntu-a:~$ sudo /etc/init.d/smbd restart
    Rather than invoking init scripts through /etc/init.d, use the service(8)
    utility, e.g. service smbd restart
    
    Since the script you are attempting to invoke has been converted to an
    Upstart job, you may also use the stop(8) and then start(8) utilities,
    e.g. stop smbd ; start smbd. The restart(8) utility is also available.
    smbd stop/waiting
    smbd start/running, process 15086

    现在在windows中就可以通过“\\<ip地址\inlucde”访问linux资源了。

  • 相关阅读:
    检测后缀表达式的合法性
    对表达式进行空白符预处理
    字符串替换
    中缀表达式的计算
    Linux shell编程
    Linux常用shell
    [转载]shell脚本编写规范
    [转载]Linux文件类型
    Linux的进程
    Linux进入命令行模式
  • 原文地址:https://www.cnblogs.com/tonybuaa/p/3052302.html
Copyright © 2011-2022 走看看