samba服务器挂载访问失败

samba服务器挂载访问失败
Q1:

[root@samba-client /]# mount.cifs -o user=stu,pass=123456  //192.168.221.129/share /stu1
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

挂载失败,没有权限

A:

1、检查挂载的文件夹是否有权限(给与777测试),配置文件中分享的模块是否给与用户权限?

2、更换挂载命令(怀疑是否是软件版本问题导致命令不可用?)

mount -t cifs  -o user=stu,pass=123456  //192.168.221.129/share /stu1

3、//192.168.221.129/share中的share是标签名,而不是路径,是否写错?

4、使用pdbedit -L 命令查看用户是否加入samba服务器?

结果发现用户名写错了,所以挂载失败·······

Q2:

再次挂载,又报错

[root@samba-client /]# mount.cifs -o user=stu1,pass=123456 //192.168.221.129/share /stu1
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

目录不存在?

A:

1、检查文件夹及配置文件,是否设置错误,文件夹名是否写错?

2、 检查共享文件列表

[root@samba-client /]# smbclient -L  //192.168.221.129/
Enter root's password: 
Anonymous login successful
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.6.9-164.el6]

    Sharename       Type      Comment
    ---------       ----      -------
    devops          Printer   samba-server test
    share           Printer   share
    IPC$            IPC       IPC Service (Samba Server Version 3.6.9-164.el6)
Anonymous login successful
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.6.9-164.el6]

    Server               Comment
    ---------            -------
    SAMBA-SERVER         Samba Server Version 3.6.9-164.el6

    Workgroup            Master
    ---------            -------
    MYGROUP              SAMBA-SERVER

发现share的TYPE是Printer,又因为-o参数是指定磁盘的,怀疑是否是因为share的共享格式有问题。

3、检查配置文件设置内容

[share]
297         comment =share
298         valid users =stu1
299         path = /tmp/samba/share
300         public = yes
301         writable = yes
302         browseable = yes
303         readonly = no

// 将printable = yes这个打印选项删除

再次查看共享文件夹类型。
[root@samba-client /]# smbclient -L  //192.168.221.129/
Enter root's password: 
Anonymous login successful
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.6.9-164.el6]

    Sharename       Type      Comment
    ---------       ----      -------
    devops          Printer   samba-server test
    share           Disk      share
    IPC$            IPC       IPC Service (Samba Server Version 3.6.9-164.el6)
Anonymous login successful

发现share的TYPE选项变为了DISK

4、再次挂载

[root@samba-client /]# mount.cifs -o user=stu1,pass=123456 //192.168.221.129/share /stu1

//成功!

5、监测

[root@samba-client /]# mount.cifs -o user=stu1,pass=123456 //192.168.221.129/share /stu1
[root@samba-client /]# df -h
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/vg_min1-lv_root   13G  1.6G   11G  14% /
tmpfs                        491M     0  491M   0% /dev/shm
/dev/sda1                    485M   33M  427M   8% /boot
/dev/sr0                     4.2G  4.2G     0 100% /mnt/dvd
//192.168.221.129/share       13G  1.3G   11G  11% /stu1
(reverse-i-search)`mount ': ^Cunt -t cifs  -o user=test,pass=123456  //192.168.221.129/devops/test /samba

df -h可以查看到,挂载成功,已经可以使用了。

你可能感兴趣的:(Linux服务,Linux,QA,Linux,samba服务)