-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUbuntu SAMBA.sh
More file actions
69 lines (55 loc) · 1.44 KB
/
Ubuntu SAMBA.sh
File metadata and controls
69 lines (55 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Install and Configure Samba
sudo apt update
sudo apt install samba
smbd --version
mkdir -p /home/<username>/Publiczny
sudo mkdir -p /home/<username>/Publiczny
sudo chmod 0777 /home/<username>/Publiczny
# Configure Samba
sudo nano /etc/samba/smb.conf
# Open the configuration file
[global]
workgroup = WORKGROUP # Default workgroup name for Windows networks
server string = Samba Server %v
security = user # Requires users to authenticate
# Public share - read-only for everyone
[Public]
comment = Samba on Ubuntu
path = /srv/samba/public
browsable = yes
writable = no
guest ok = yes
read only = yes
# Private share - authenticated users only
[Private]
comment = Samba on Ubuntu
path = /home/krzysiek/Publiczny
browsable = yes
writable = yes
guest ok = no
valid users = @smbusers
create mask = 0660
directory mask = 0770
# How to add a user to Samba
sudo smbpasswd -a <username>
# Restart Samba
sudo service smbd restart
sudo ufw allow samba
# On Windows, open up File Manager and edit the file path to:
\\ip-address\Publiczny
# From Linux, open up File Manager
smb://ip-address/Publiczny
# How to Assign Static IP Address
ip add show
netstat -r -n
sudo vi /etc/netplan/00-installer-config.yaml
network:
ethernets:
enp0s3:
dhcp4: false
addresses: [192.168.1.3/24]
gateway4: 192.168.1.1
nameservers:
addresses: [4.2.2.2, 8.8.8.8]
version: 2
sudo netplan apply