我可以使用 nautilus 安装我的 SMB 共享,只需添加位置即可smb://ip
以下是我在另一台计算机上使用 smbclient 时发生的情况:
lz@air:/media$ smbclient -L //192.168.0.3
WARNING: The "syslog" option is deprecated
Enter WORKGROUP\lz's password:
OS=[Windows 6.1] Server=[Samba 4.5.12-Debian]
Sharename Type Comment
--------- ---- -------
Public Disk
IPC$ IPC IPC Service (Samba 4.5.12-Debian)
Connection to 192.168.0.3 failed (Error NT_STATUS_CONNECTION_REFUSED)
NetBIOS over TCP disabled -- no workgroup available
这是本地的,到本地主机:
pi@raspberrypi:~ $ smbclient -L localhost
WARNING: The "syslog" option is deprecated
Enter pi's password:
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.5.12-Debian]
Sharename Type Comment
--------- ---- -------
Public Disk
IPC$ IPC IPC Service (Samba 4.5.12-Debian)
Connection to localhost failed (Error NT_STATUS_CONNECTION_DISCONNECTED)
NetBIOS over TCP disabled -- no workgroup available
这是我的 SAMBA 配置:
RUN echo '[global]\n\
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536\n\
smb ports = 445\n\
max protocol = SMB2\n\
min receivefile size = 16384\n\
deadtime = 30\n\
os level = 20\n\
map to guest = bad user\n\
printer = bsd\n\
printcap name = /dev/null\n\
load printers = no\n\
create mask = 0644\n\
force create mode = 0644\n\
directory mask = 0755\n\
force directory mode = 0755\n\
browsable = yes\n\
writable = yes\n\
guest account = root\n\
force user = root\n\
force group = root\n\
[Public]\n\
path = /data/share\n\
guest ok = yes\n\
read only = no' > /etc/samba/smb.conf
值得一提的是,我的 Samba 没有密码
更新:
按照下面的评论操作后,我
lz@air:~$ smbclient -L //192.168.0.3
WARNING: The "syslog" option is deprecated
Enter WORKGROUP\lz's password:
OS=[Windows 6.1] Server=[Samba 4.5.12-Debian]
Sharename Type Comment
--------- ---- -------
Public Disk
IPC$ IPC IPC Service (Samba 4.5.12-Debian)
OS=[Windows 6.1] Server=[Samba 4.5.12-Debian]
Server Comment
--------- -------
Workgroup Master
--------- -------
WORKGROUP
我不应该看到我的文件夹吗?我该如何安装它?
答案1
[1] 编辑/etc/samba/smb.conf
[2] 在 smb ports = 445 前面放置一个 # 符号,使其看起来像这样:
#smb ports = 445
这将使 samba 不会读取该行并且它将默认使用端口 445 和 139。
[3]重新启动smbd服务:
sudo service smbd restart
我不应该看到我的文件夹吗?
smbclient -L 仅列出服务器上可用的共享 - 并且您有一个名为 Public
我该如何安装它?
smbclient //192.168.0.3/Public
您将最终看到命令提示符:smb: \>
输入 ls
以获取公共内容列表并quit
关闭连接。