Let see my setup environment:
Server:
- Arch Linux 4.2.5-1-ARCH
- samba Version 4.3.3
Client:
Same as server
Network Setup:
Internet - Server(192.168.1) - Router(192.168.2) - Clients
= = =
Setup procedure:
1. Installation: (For both server and client)
#pacman -Syu samba
2. Setup config
I have made a config file to share the server /tmp folder and allow only me and home subnet only.
= = =
[global]
workgroup = WORKGROUP
server string = Samba Server
hosts allow = 192.168.1. 127.
printcap name = /etc/printcap
load printers = yes
log file = /var/log/samba/%m.log
max log size = 50
security = user
dns proxy = no
invalid users = nobody root
map to guest = Bad User
max connections = 10
[homes]
comment = Home Directories
browseable = no
writable = yes
[tmp]
comment = Temporary file space
path = /tmp
valid users = your_user
public = no
writable = yes
= = =
Configure your user to samba, and enter the user password.
#pdbedit -a -u your_user
3. Run
In server:
#systemctl enable smbd.service
If you also need netbios support:
#systemctl enable nmbd.service
Server side should be more or less ready and change to Client
Client:
Just test the samba connection to the server
user@localhost:~$ smbclient -L 192.168.1.1 -U your_user
smbclient: Can't load /etc/samba/smb.conf - run testparm to debug it
Enter your_user's password:
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.3.3]
Sharename Type Comment
--------- ---- -------
tmp Disk Temporary file space
IPC$ IPC IPC Service (Samba Server)
your_user Disk Home Directories
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.3.3]
Server Comment
--------- -------
LOCALHOST Samba Server
Workgroup Master
--------- -------
WORKGROUP LOCALHOST
If you see similar output, the connection should be ready and you can mount remote samba drive
#mount -t cifs //LOCALHOST/tmp /mnt -o user=your_user,workgroup=WORKGROUP,ip=192.168.1.1
password:
Nice and Done!!
沒有留言:
張貼留言