• 【教程】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”即可

     

  • 相关阅读:
    计算机专业,刚刚大一,该如何学好程序设计?
    打王者要有装备,学编程要有设备,学习编程必备大礼包
    Java学习笔记:数据库中的范式和反范式的区别
    linux云计算主要就业岗位有哪些
    字典
    python统计字符串里每个字符的次数
    cf509B Painting Pebbles
    cf509A Maximum in Table
    bzoj1996 [Hnoi2010]chorus 合唱队
    bzoj3173 [Tjoi2013]最长上升子序列
  • 原文地址:https://www.cnblogs.com/lcw/p/3200874.html
Copyright © 2020-2023  润新知