找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888广告投放联系QQ68610888
广告投放联系QQ68610888广告投放联系QQ68610888
查看: 7042|回复: 25

(已解决)求助,samba 打不开是我的设置问题吗,...

[复制链接]
发表于 2019-4-6 23:13 | 显示全部楼层 |阅读模式
本帖最后由 xiaoluoabc123 于 2019-4-7 18:29 编辑

samba 打不开是我的设置问题吗,有图,现在卡在打不开sda1硬盘上了(解决了是新建用户的权限问题,换回root用户更改密码就可以了)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
发表于 2019-4-6 23:27 | 显示全部楼层
你的已经挂载的文件系统sda1根本没有挂载,如何共享?

点评

你说的对啊,怎么没有挂载上呢,已经启用了  详情 回复 发表于 2019-4-6 23:32
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
回复

使用道具 举报

发表于 2019-4-6 23:30 | 显示全部楼层
你看看

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
回复

使用道具 举报

 楼主| 发表于 2019-4-6 23:32 | 显示全部楼层
boboa 发表于 2019-4-6 23:27
你的已经挂载的文件系统sda1根本没有挂载,如何共享?

你说的对啊,怎么没有挂载上呢,已经启用了
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
回复

使用道具 举报

发表于 2019-4-6 23:37 | 显示全部楼层
配置文件的问题

点评

老哥,具体能指导下不  详情 回复 发表于 2019-4-6 23:38
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
回复

使用道具 举报

 楼主| 发表于 2019-4-6 23:38 | 显示全部楼层
boboa 发表于 2019-4-6 23:37
配置文件的问题

老哥,具体能指导下不
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
回复

使用道具 举报

发表于 2019-4-6 23:41 | 显示全部楼层

我是全部选择上了。另外用winscp修改了/etc/hotplug.d/block/10-mount,和15-automount,就可以了。

#!/bin/ash


case "$ACTION" in
        add)
                for i in $(ls /dev/ | grep 'sd[a-z][1-9]')
                do
                        mkdir -p /mnt/$i
                        mount -o iocharset=utf8,rw /dev/$i /mnt/$i
                        if [ $? -ne 0 ]
                        then
                                mount -o rw /dev/$i /mnt/$i
                        fi
                done
                ;;
        remove)
                MOUNT=`mount | grep -o '/mnt/sd[a-z][1-9]'`
                for i in $MOUNT
                do
                        umount $i
                        if [ $? -eq 0 ]
                        then
                                rm -r $i
                        fi
                done
                ;;
esac
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
回复

使用道具 举报

发表于 2019-4-6 23:43 | 显示全部楼层
用winscp修改了/etc/hotplug.d/block/10-mount,和15-automount,就可以了。把2个里面的内容清除,把上面的代码拷贝进去,重启路由器就可以了

点评

能挂载上了,但我只修改了10-mount, 15-automount 没找到这个文件,但是现在确实挂载上了,谢谢老哥  详情 回复 发表于 2019-4-7 00:41
好的谢谢,我试试  详情 回复 发表于 2019-4-7 00:06
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
回复

使用道具 举报

 楼主| 发表于 2019-4-7 00:06 | 显示全部楼层
boboa 发表于 2019-4-6 23:43
用winscp修改了/etc/hotplug.d/block/10-mount,和15-automount,就可以了。把2个里面的内容清除,把上面的 ...

好的谢谢,我试试
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
回复

使用道具 举报

 楼主| 发表于 2019-4-7 00:41 | 显示全部楼层
boboa 发表于 2019-4-6 23:43
用winscp修改了/etc/hotplug.d/block/10-mount,和15-automount,就可以了。把2个里面的内容清除,把上面的 ...

能挂载上了,但我只修改了10-mount, 15-automount 没找到这个文件,但是现在确实挂载上了,谢谢老哥
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
回复

使用道具 举报

发表于 2019-4-7 07:09 | 显示全部楼层
没有15-automount,是因为你的固件编译的时候没有选automount

点评

估计是我用的是openwrt 官方固件的问题,另外我这个samba共享文件打不开是什么情况呢[attachimg]280375[/attachimg]  详情 回复 发表于 2019-4-7 10:41
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
回复

使用道具 举报

 楼主| 发表于 2019-4-7 10:41 | 显示全部楼层
boboa 发表于 2019-4-7 07:09
没有15-automount,是因为你的固件编译的时候没有选automount

估计是我用的是openwrt 官方固件的问题,另外我这个samba共享文件打不开是什么情况呢

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
回复

使用道具 举报

发表于 2019-4-7 10:45 | 显示全部楼层
xiaoluoabc123 发表于 2019-4-7 10:41
估计是我用的是openwrt 官方固件的问题,另外我这个samba共享文件打不开是什么情况呢

你需要在电脑端用映射网络驱动器映射一个sda1

点评

我试试啊,这个samba不是应该直接可以浏览吗  详情 回复 发表于 2019-4-7 10:49
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
回复

使用道具 举报

 楼主| 发表于 2019-4-7 10:49 | 显示全部楼层
boboa 发表于 2019-4-7 10:45
你需要在电脑端用映射网络驱动器映射一个sda1

我试试啊,这个samba不是应该直接可以浏览吗
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
回复

使用道具 举报

发表于 2019-4-7 10:50 | 显示全部楼层
你在samba编辑模板那里用下面的替换试试[global]
        netbios name = |NAME|
        interfaces = |INTERFACES|
        server string = |DESCRIPTION|
        unix charset = |CHARSET|
        workgroup = |WORKGROUP|

        ## This global parameter allows the Samba admin to limit what interfaces on a machine will serve SMB requests.
        bind interfaces only = yes
       
        ## time for inactive connections to-be closed in minutes
        deadtime = 15
       
        ## disable core dumps
        enable core files = no
       
        ## set security (auto, user, domain, ads)
        security = user
       
        ## This parameter controls whether a remote client is allowed or required to use SMB encryption.
        ## It has different effects depending on whether the connection uses SMB1 or SMB2 and newer:
    ## If the connection uses SMB1, then this option controls the use of a Samba-specific extension to the SMB protocol introduced in Samba 3.2 that makes use of the Unix extensions.
        ## If the connection uses SMB2 or newer, then this option controls the use of the SMB-level encryption that is supported in SMB version 3.0 and above and available in Windows 8 and newer.
        ##(default/auto,desired,required,off)
        #smb encrypt = default
       
        ## set invalid users
        invalid users = root
       
        ## map unknow users to guest
        map to guest = Bad User

        ## allow client access to accounts that have null passwords.
        null passwords = yes
       
        ## The old plaintext passdb backend. Some Samba features will not work if this passdb backend is used. (NOTE: enabled for size reasons)
        ## (tdbsam,smbpasswd,ldapsam)
        passdb backend = smbpasswd
       
        ## Set location of smbpasswd ('smbd -b' will show default compiled location)
        #smb passwd file = /etc/samba/smbpasswd
       
        ## LAN/WAN options (IPTOS_LOWDELAY TCP_NODELAY) WAN (IPTOS_THROUGHPUT)
        socket options = IPTOS_LOWDELAY TCP_NODELAY
       
        ## lower CPU useage if supported
        use sendfile = yes
       
        ## samba will behave as previous versions of Samba would and will fail the lock request immediately if the lock range cannot be obtained.
        #blocking locks = No
       
        ## disable loading of all printcap printers by default (iprint, cups, lpstat)
        load printers = No
        printcap name = /dev/null

        ## Enabling this parameter will disable Samba's support for the SPOOLSS set of MS-RPC's.
        disable spoolss = yes
       
        ## This parameters controls how printer status information is interpreted on your system.
        ## (BSD, AIX, LPRNG, PLP, SYSV, HPUX, QNX, SOFTQ)
        printing = bsd
       
        ## Disable that nmbd is acting as a WINS server for unknow netbios names
        #dns proxy = No
       
        ## win/unix user mapping backend
        #idmap config * : backend = tdb
       
        ## Allows the server name that is advertised through MDNS to be set to the hostname rather than the Samba NETBIOS name.
        ## This allows an administrator to make Samba registered MDNS records match the case of the hostname rather than being in all capitals.
        ## (netbios, mdns)
        mdns name = mdns
       
        ## Clients that only support netbios won't be able to see your samba server when netbios support is disabled.
        #disable netbios = Yes
       
        ## Setting this value to no will cause nmbd never to become a local master browser.
        #local master = no

        ## (auto, yes) If this is set to yes, on startup, nmbd will force an election, and it will have a slight advantage in winning the election. It is recommended that this parameter is used in conjunction with domain master = yes, so that nmbd can guarantee becoming a domain master.
        #preferred master = yes

        ## (445 139) Specifies which ports the server should listen on for SMB traffic.
        ## 139 is netbios/nmbd
        #smb ports = 445 139
       
        ## This is a list of files and directories that are neither visible nor accessible.
        ## Each entry in the list must be separated by a '/', which allows spaces to be included in the entry. '*' and '?' can be used to specify multiple files or directories as in DOS wildcards.
        veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/
       
        ## If a directory that is to be deleted contains nothing but veto files this deletion will fail unless you also set the delete veto files parameter to yes.
        delete veto files = yes
       
################ Filesystem and creation rules ################
        ## reported filesystem type (NTFS,Samba,FAT)
        #fstype = FAT
       
        ## Allows a user who has write access to the file (by whatever means, including an ACL permission) to modify the permissions (including ACL) on it.
        #dos filemode = Yes
       
        ## file/dir creating rules
        #create mask = 0666
        #directory mask = 0777
        #force group = root
        #force user = root
        #inherit owner = windows and unix
################################################################

点评

哎,搞了一天 还是不行,mnt目录能打开,但是到sda1就是打不开,我改sda1权限,提示read open only  详情 回复 发表于 2019-4-7 17:38
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /2 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2026-8-23 21:10

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 电话:13506125623

快速回复 返回顶部 返回列表