我遇到了试图在另一个CentOS服务器共享的CentOS服务器上挂载文件夹的问题。
我在https://www.howtogeek.com/176471/how-to-share-files-between-windows-and-linux/上设置了选项2
我设法在Windows上安装共享,所以我不认为我的托pipe服务器上有防火墙问题。
我试图用autofs挂载这个,这是我的configuration:
winbox -fstype=cifs,rw,noperm,user=USERNAME,pass=PASSWORD ://MYIPADDRESS/Share
当我尝试cd到相关的文件夹,我在我的日志中得到以下内容:
Sep 19 00:29:35 Base automount[28600]: handle_packet: type = 3 Sep 19 00:29:35 Base automount[28600]: handle_packet_missing_indirect: token 76, name winbox, request pid 24536 Sep 19 00:29:35 Base automount[28600]: attempting to mount entry /mymountfolder/winbox Sep 19 00:29:35 Base automount[28600]: lookup_mount: lookup(file): looking up winbox Sep 19 00:29:35 Base automount[28600]: lookup_mount: lookup(file): winbox -> -fstype=cifs,rw,noperm,user=USERNAME,pass=PASSWORD ://MYIPADDRESS/Share Sep 19 00:29:35 Base automount[28600]: parse_mount: parse(sun): expanded entry: -fstype=cifs,rw,noperm,user=USERNAME,pass=PASSWORD ://MYIPADDRESS/Share Sep 19 00:29:35 Base automount[28600]: parse_mount: parse(sun): gathered options: fstype=cifs,rw,noperm,user=USERNAME,pass=PASSWORD Sep 19 00:29:35 Base automount[28600]: parse_mount: parse(sun): dequote("://MYIPADDRESS/Share") -> ://MYIPADDRESS/Share Sep 19 00:29:35 Base automount[28600]: parse_mount: parse(sun): core of entry: options=fstype=cifs,rw,noperm,user=USERNAME,pass=PASSWORD, loc=://MYIPADDRESS/Share Sep 19 00:29:35 Base automount[28600]: sun_mount: parse(sun): mounting root /mymountfolder, mountpoint winbox, what //MYIPADDRESS/Share, fstype cifs, options rw,noperm,user=USERNAME,pass=PASSWORD Sep 19 00:29:35 Base automount[28600]: do_mount: //MYIPADDRESS/Share /mymountfolder/winbox type cifs options rw,noperm,user=USERNAME,pass=PASSWORD using module generic Sep 19 00:29:35 Base automount[28600]: mount_mount: mount(generic): calling mkdir_path /mymountfolder/winbox Sep 19 00:29:35 Base automount[28600]: mount_mount: mount(generic): calling mount -t cifs -s -o rw,noperm,user=USERNAME,pass=PASSWORD //MYIPADDRESS/Share /mymountfolder/winbox Sep 19 00:29:35 Base automount[28600]: spawn_mount: mtab link detected, passing -n to mount Sep 19 00:29:35 Base automount[28600]: >> Unable to find suitable address. Sep 19 00:29:35 Base automount[28600]: mount(generic): failed to mount //MYIPADDRESS/Share (type cifs) on /mymountfolder/winbox Sep 19 00:29:35 Base automount[28600]: dev_ioctl_send_fail: token = 76 Sep 19 00:29:35 Base automount[28600]: failed to mount /mymountfolder/winbox Sep 19 00:29:35 Base automount[28600]: handle_packet: type = 3 Sep 19 00:29:35 Base automount[28600]: handle_packet_missing_indirect: token 77, name winbox, request pid 24536 Sep 19 00:29:35 Base automount[28600]: dev_ioctl_send_fail: token = 77 Sep 19 00:29:35 Base automount[28600]: handle_packet: type = 3 Sep 19 00:29:35 Base automount[28600]: handle_packet_missing_indirect: token 78, name winbox, request pid 24536 Sep 19 00:29:35 Base automount[28600]: dev_ioctl_send_fail: token = 78
问题的根源在于我能说的是:
>> Unable to find suitable address.
当我试图直接安装它时,我遇到了同样的问题。 然而,我所能find的并没有把我指向正确的方向。
我可以ping通IP地址就好了,这也不是本地服务器。
我想我已经把问题缩小到了主机服务器上的防火墙上。 我在我的iptables中有以下内容:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 445 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
如果我禁用iptables的东西工作得很好,所以我必须错过上面的东西。