[求解]无法访问windows局域网共享
Tofloor
poster avatar
ltofuy
deepin
2014-07-22 02:16
Author
我们的Linux机器是在一个局域网中的
局域网由一个双网卡共享的XP作为主机(一个连接外网一个网卡连接内网,内网接路由器,关闭DHCP)
客户机IP静态手动指定

现在在这个环境的局域网内,Linux无法直接在网络连接里访问Windows的共享资源,直接显示服务器共享目录超时

但是,smb://workgroup/
可以看到局域网的共享的电脑,但是后面的last modified时间是1970年= =。。。
使用smb://+ip地址
可以访问局域网资源,但是就是不能在图形界面里访问
求问解决方法
Reply Favorite View the author
All Replies
cxbii
deepin
2014-07-22 07:26
#1
貌似是文件管理器的bug。。
Reply View the author
electricface
deepin
2014-07-25 22:54
#2
献上一个perl函数,我就是用它来挂载samba 共享的
  1. sub mount_smb {
  2.         my ( $smb_location , $mount_path ) = @_;
  3.         my $mount_stat =qx( mount -l|grep $smb_location );
  4.         my @smb_dir_files = <$mount_path/*>;
  5.         if ( @smb_dir_files ){
  6.                 print "ok $mount_stat\n";
  7.         } else {
  8.                 print "no mount ***???\n";
  9.                 qx(sudo mkdir -p $mount_path);
  10.                 my $mount_smb_cmd = "sudo mount -t cifs $smb_location $mount_path -o " .
  11.                 "username=$SMB_USERNAME,password=$SMB_PASSWD,domain=WORKGROUP,uid=$<,forceuid";
  12.                 qx($mount_smb_cmd);
  13.                 if ( $? == 0 ){
  14.                         print "Mount Samba service " . qx( mount -l |grep $smb_location )."\n";
  15.                 } else { die "mount failed (exit code $?)"}
  16.         }
  17. }
Copy the Code
Reply View the author
hehethegreat
deepin
2014-07-25 23:12
#3
/etc/samba/smb.conf
netbios name =
name resolve order = bcast host


restart pc
Reply View the author