我可以通过简单地添加位置来使用 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] 编辑
/etc/samba/smb.conf
[2] 在 smb ports = 445 前面放置一个 # 符号,使其看起来像这样:
#smb ports = 445
这将使 samba 不会读取该行,它将默认使用端口 445 和 139。
[3]重启smbd服务:
smbclient -L 只列出服务器上可用的共享 - 你有一个名为 Public
您将在命令提示符下结束:
smb: \>
输入
ls
以获取 Public 的内容列表并quit
关闭连接。