Kali Linux Setup Samba Share for Home LAN: Difference between revisions
From WikiMLT
Line 9: | Line 9: | ||
== Samba Basic Setup == | == Samba Basic Setup == | ||
Add or modify the following lines within <code>smb.conf</code>.<syntaxhighlight lang="shell" line="1" class="mlw-continue"> | |||
sudo nano /etc/samba/smb.conf | |||
</syntaxhighlight><syntaxhighlight lang="shell" line="1" class="mlw-continue mlw-shell-gray"> | |||
cat /etc/samba/smb.conf | grep -Pv '^(;|#|\s.*#)' | sed '/^$/d' | |||
</syntaxhighlight><syntaxhighlight lang="terraform"> | |||
[global] | |||
client min protocol = LANMAN1 | |||
server min protocol = LANMAN1 | |||
workgroup = WORKGROUP | |||
interfaces = 127.0.0.0/8 eth0 br0 | |||
log file = /var/log/samba/log.%m | |||
max log size = 1000 | |||
logging = file | |||
panic action = /usr/share/samba/panic-action %d | |||
server role = standalone server | |||
obey pam restrictions = yes | |||
unix password sync = yes | |||
passwd program = /usr/bin/passwd %u | |||
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . | |||
pam password change = yes | |||
map to guest = bad user | |||
usershare allow guests = yes | |||
usershare owner only = false | |||
[homes] | |||
comment = Home Directories | |||
browseable = no | |||
read only = yes | |||
create mask = 0700 | |||
directory mask = 0700 | |||
valid users = %S | |||
[printers] | |||
comment = All Printers | |||
browseable = no | |||
path = /var/spool/samba | |||
printable = yes | |||
guest ok = no | |||
read only = yes | |||
create mask = 0700 | |||
[print$] | |||
comment = Printer Drivers | |||
path = /var/lib/samba/printers | |||
browseable = yes | |||
read only = yes | |||
guest ok = no | |||
</syntaxhighlight> | |||
== References == | == References == |
Revision as of 13:56, 14 September 2022
Install Samba
sudo apt install samba smbclient nautilus-share
sudo usermod -aG sambashare $USER
Samba Basic Setup
Add or modify the following lines within smb.conf
.
sudo nano /etc/samba/smb.conf
cat /etc/samba/smb.conf | grep -Pv '^(;|#|\s.*#)' | sed '/^$/d'
[global]
client min protocol = LANMAN1
server min protocol = LANMAN1
workgroup = WORKGROUP
interfaces = 127.0.0.0/8 eth0 br0
log file = /var/log/samba/log.%m
max log size = 1000
logging = file
panic action = /usr/share/samba/panic-action %d
server role = standalone server
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes
usershare owner only = false
[homes]
comment = Home Directories
browseable = no
read only = yes
create mask = 0700
directory mask = 0700
valid users = %S
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
References
- …
- …