zoukankan      html  css  js  c++  java
  • 【教程】ubuntu下安装samba服务器

    一、准备工作

      首先更新 software sources, 找到最快的源 

    lcw@ubuntu:~$ sudo apt-get update

    二、安装samba

    lcw@ubuntu:~$ sudo apt-get install samba smbfs samba-common smbclient

    三、创建samba配置文件

    1. 保存现有的配置文件 

    lcw@ubuntu:~$ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

    2. 编辑配置文件

    lcw@ubuntu:~$ sudo vim /etc/samba//smb.conf

      在smb.conf最后添加

    [username] 
    
    path=/home/username 
    
    available=yes 
    
    browseable=yes 
    
    public=yes 
    
    writable =yes 

       (注意: 上面的设置中,username 换成你的用户名如果在前面有“#”,需要先把它去掉,path必须是已经创建的路径

    四、创建samba帐户

    lcw@ubuntu:~$ sudo smbpasswd -a lcw

      Lcw换成自己的用户名

      这里会要求你输入samba帐户的密码

    lcw@ubuntu:~$ sudo smbpasswd -a lcw
    
    New SMB password:
    
    Retype new SMB password:
    
    Added user lcw.
    
    lcw@ubuntu:~$ 

    五、重启samba服务器

    lcw@ubuntu:~$ sudo /etc/init.d/smbd reload
    
    Rather than invoking init scripts through /etc/init.d, use the service(8)
    
    utility, e.g. service smbd reload
    
     
    
    Since the script you are attempting to invoke has been converted to an
    
    Upstart job, you may also use the reload(8) utility, e.g. reload smbd
    
    lcw@ubuntu:~$ 

      修改过smb.conf 的话要执行一次

    lcw@ubuntu:~$ 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 5886
    
    lcw@ubuntu:~$ 

    六、测试

      到windows下输入ubuntu ip试一下

      在“我的电脑”或者在“运行”处输入“\+ubuntu机器的ip”即可

     

  • 相关阅读:
    css3.0新属性效果在ie下的解决方案(兼容性)
    ajax实现md5加密
    ajax给全局变量赋值问题
    前端资源分享
    7件你不知道但可以用CSS做的事
    jQuery 常用效果
    ThinkPHP redirect 传参
    join和split 的使用
    JSON_FORCE_OBJECT 数字索引数组 强转对象
    layer 弹框不显示内容
  • 原文地址:https://www.cnblogs.com/lcw/p/3200874.html
Copyright © 2011-2022 走看看