文章

Windows访问Linux的samba共享慢的原因和解决办法

问题表现

  • Windows 下访问Linux共享地址第一次打开时特别1-2分钟左右
  • 连接成功后打开很快

原因

  • Linux主机名和/etc/hosts配置不一样
1
2
3
4
5
#hostname
xxx-xxx-xxx  
#cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4  
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

解决办法

  • 修改/etc/hosts. 添加正确的主机名
1
2
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4  xxx-xxx-xxx  
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6  xxx-xxx-xxx
本文由作者按照 CC BY 4.0 进行授权