AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1289901
Accepted
Nicholas Bourbaki
Nicholas Bourbaki
Asked: 2020-11-06 08:28:54 +0800 CST2020-11-06 08:28:54 +0800 CST 2020-11-06 08:28:54 +0800 CST

Samba 客户端无法在 Ubuntu 18.04 上运行,需要帮助

  • 772

我正在使用 Samba 客户端尝试从 Linux 查看驻留在 Windows-10 64 位计算机上的共享目录。samba 安装在我的 xUbuntu 18.04 64 位笔记本电脑上。XUbuntu 就像普通的 Ubuntu 一样,只是它使用了我喜欢的 XFCE 桌面。我对我的 /etc/samba/smb.conf 做了一些更改,但不清楚具体需要做什么。

两台计算机都是“FSI”工作组的一部分。我启动服务 smbd 和 nmbd。然后,通过 Linux 笔记本电脑上的文件浏览器,我可以转到 FSI 工作组并查看 Windows 机器 {名为“TIBERIUS”} 以及名为 {“XENOBA-LIN”} 的 Linux 笔记本电脑。但是我不能去查看共享目录或 TIBERIUS 上的任何目录。当两台机器都重新启动到 Windows 时,我可以。

我不希望 Linux 笔记本电脑成为服务器,因为它只是间歇性地在网络上。windows 机器应该是主要的名称服务器和服务器。这是我在 Linux 机器上的 smb.conf 的缩写副本。

/etc/samba/smb.conf

#======================= Global Settings =======================
[global]
## Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = FSI

# server string is the equivalent of the NT Description field
    server string = %h server (Samba, Ubuntu)

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
   wins support = yes

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
#   wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
   dns proxy = no

#### Networking ####
### note IP 192.168.1.72 is for Tiberius: the remote Windows machine  ####
### anyhow it's commented out I think  ###
;   interfaces = 192.168.1.72/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
;   bind interfaces only = yes
####### Authentication #######

# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller". 
#
# Most people will want "standalone sever" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
   server role = standalone server

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.  
   passdb backend = tdbsam

   obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
   unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<[email protected]> for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
   pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
   map to guest = bad user

########## Domains ###########

############ Misc ############
# all the usual defaults here except when listed

# Maximum number of usershare. 0 (default) means that usershare is disabled.
;   usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
   usershare allow guests = yes

我还要附上截图

工作组发现这就是我所能得到的

networking samba client file-sharing
  • 2 2 个回答
  • 1822 Views

2 个回答

  • Voted
  1. Best Answer
    Morbius1
    2020-11-07T08:53:05+08:002020-11-07T08:53:05+08:00

    但我不能去查看共享目录或 TIBERIUS 上的任何目录

    我不希望 Linux 笔记本电脑成为服务器,因为它只是间歇性地在网络上。

    文件管理器的 gvfs 后端 ( gvfsd-smb-browse ) 中存在一个错误,该错误尝试使用 Win10 已禁用的 smb ( smb1 ) 方言访问 Win10 主机及其共享。

    这并不意味着您无法访问 Win10 服务器 - 您只需通过在 Thunar 中通过其 mDNS 主机名和共享名显式询问主机来绕过该错误:

    smb://tiberius.local/share-name
    

    这.local部分是Win10现在默认可以做的事情。

    • 2
  2. kyodake
    2020-11-06T15:58:57+08:002020-11-06T15:58:57+08:00

    Samba 配置文件可能会令人困惑。

    我将向您展示如何使用图形工具 (system-config-samba) 来设置 Samba 服务器。

    通过在终端中运行以下命令,从 Ubuntu 存储库安装 Samba 服务器套件。

    sudo apt-get install --reinstall samba samba-common-bin
    

    要启动这两个服务,请发出以下命令:

    sudo systemctl start smbd
    sudo systemctl start nmbd
    

    现在运行以下命令来安装 system-config-samba

    sudo apt-get install system-config-samba
    sudo touch /etc/libuser.conf
    

    创建一个 Samba 用户,将用户名替换为您喜欢的用户名

    sudo adduser username
    

    为新用户设置密码,可以回车回答剩下的问题

    还需要为用户设置单独的 Samba 密码。

    sudo smbpasswd -a username
    

    启动system-config-samba,运行以下命令

    sudo system-config-samba
    

    在 Samba GUI 中,单击 Preferences ---> Server Settings 菜单。

    确保 workgroup 的值与 Windows 计算机的工作组设置相同。

    然后单击加号按钮创建 Samba 共享,并在 Basic 选项卡中指定

    The directory/folder you want to share
    The share name
    A description of the share
    Whether the remote user can write to the Samba share or not
    Whether other computers in your network can see the Samba share or not
    

    在 Access 选项卡中,选择您刚刚创建的 Samba 用户,然后单击 OK。

    如果没有显示 Samba 用户,请重新启动 system-config-samba。

    如果您选择允许所有人访问,则同一网络中的其他人无需输入用户名和密码即可访问共享文件夹。

    您可以使用 Samba 和 Thunar 快速共享文件夹,而无需 root 访问权限。

    • 1

相关问题

  • 如何限制下载/上传带宽?

  • 如何通过 Windows 网络共享文件?

  • 如何设置 Ubuntu Server 10.04 LTS 作为 samba 主域控制器使用 pam 模块对 LDAP 服务器进行身份验证?

  • 面板小程序以文本形式显示当前网络流量?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve