栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

linux ubuntu的samba配置

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

linux ubuntu的samba配置


一、下载samba服务器,
sudo apt-get update

li@li:/mnt/c/Users/lizhi$ sudo apt-get update
[sudo] password for li:
Ign:1 http://mirrors.ustc.edu.cn/ubuntu precise-updates InRelease
Ign:2 http://mirrors.ustc.edu.cn/ubuntu precise InRelease

sudo apt-get upgrade

li@li:/mnt/c/Users/lizhi$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done

sudo apt-get install samba samba-common

li@li:/mnt/c/Users/lizhi$ sudo apt-get install samba samba-common
Reading package lists... Done
Building dependency tree
Reading state information... Done

二、配置samba服务器
1,修改共享目录权限
sudo chmod 777 /home/li

2,添加用户 
sudo smbpasswd -a li

li@li:~$ sudo smbpasswd -a li
New SMB password:
Retype new SMB password:

3,配置sambe的配置文件
sudo vim /etc/samba/smb.conf

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

在配置文件smb.conf的最后添加下面的内容

[li]
    comment = share folder
    browseable = yes
    path = /home/hispark
    public = yes
    available = yes
    guest ok = no
    writable = yes
    valid users = li
    create mask = 0777
    directory mask = 0777


  4,重启samba 服务器

sudo service smbd restart


li@li:~$ sudo service smbd restart
 * Stopping SMB/CIFS daemon smbd                                                                                 [ OK ]
 * Starting SMB/CIFS daemon smbd

三、ubuntu与Windows进行文件共享配置

ifconfig查看Ubuntu的IP地址

li@li:~$ ifconfig
eth0: flags=4163  mtu 1500
        inet 172.28.126.45  netmask 255.255.240.0  broadcast 172.28.127.255
        inet6 fe80::215:5dff:feb5:6f73  prefixlen 64  scopeid 0x20
        ether 00:15:5d:b5:6f:73  txqueuelen 1000  (Ethernet)
        RX packets 15969  bytes 23733705 (23.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6866  bytes 538077 (538.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 4  bytes 240 (240.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 240 (240.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
 

在Windows 按住 win+R组合键,输入IP地址 如  \xx.xx.xx.xx ,输入用户名和密码登录共享文件夹

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/827954.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号