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”即可

     

  • 相关阅读:
    Codeforces Round #615 (Div. 3)
    「网络流 24 题」最长 k 可重区间集
    「网络流 24 题」方格取数
    「网络流 24 题」试题库
    debian服务sh启动java,设置开机启动
    debian重置root密码
    uwsgi加载ini文件,nginx重新加载,查看配置文件路劲
    pptpd启动
    android studio java lib不能直接运行
    clipChildren是否限制子控件在该容器所在的范围内
  • 原文地址:https://www.cnblogs.com/lcw/p/3200874.html
Copyright © 2011-2022 走看看