第一步 安装smaba
root@debian:~# apt-get install samba samba-common
第二步 配置samba用户名和密码
root@debian:~# smbpasswd -a user
New SMB password:
Retype new SMB password:
Mismatch - password unchanged.
Unable to get new password.
第三步 配置共享目录
root@debian:~# vi /etc/samba/smb.conf
[share]
path = /home/user
available = yes
browseable = yes
public = yes
writable = yes
第四步 重启samba服务
root@debian:~# service smbd restart
root@debian:~# service smbd status
● smbd.service - Samba SMB Daemon
Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2023-03-10 09:12:05 CST; 8min ago
Docs: man:smbd(8)
man:samba(7)
man:smb.conf(5)
Process: 3630 ExecStartPre=/usr/share/samba/update-apparmor-samba-profile (code=exited, status=0/SUCCESS)
Main PID: 3631 (smbd)
Status: "smbd: ready to serve connections..."
Tasks: 5 (limit: 8950)
Memory: 8.3M
CPU: 670ms
CGroup: /system.slice/smbd.service
├─3631 /usr/sbin/smbd --foreground --no-process-group
├─3633 /usr/sbin/smbd --foreground --no-process-group
├─3634 /usr/sbin/smbd --foreground --no-process-group
├─3635 /usr/sbin/smbd --foreground --no-process-group
└─3642 /usr/sbin/smbd --foreground --no-process-group
Mar 10 09:12:05 E2000-debian systemd[1]: Starting Samba SMB Daemon...
Mar 10 09:12:05 E2000-debian systemd[1]: Started Samba SMB Daemon.