samba share setup on Linux
·
2 minute read
- install samba first
sudo apt install samba - configure samba conf file located at
/etc/samba/smb.conf - add the entry of the directory that you want to share at the end of the file
- start with [<name of the share>]
- path - path of the directory you want to share (required)
- comment - a little description of what you are sharing (optional)
- volume - defines a volume name to the share. otherwise defaults to the name of the share. (optional)
- guest ok - default is no - can be accessed by guest or not(optional)
example:
[myshare]
path = /mnt/ship/media
comment = Media files
guest ok = no
note: samba users are different from linux users. to create a samba user, run smbpasswd -a <username> as root and input a password. use this username and password to login when asked.
that’s it. now you can access your shared folder from other machines.
on macOS,
- open finder
- click on ‘Go’ > ‘Connect to Server’ from menubar. or you can press Cmd + K.
- type in your machine’s IP address (smb://
) and click on 'Connect' - type in the samba username and password when asked if you are a registered user. or click on ‘Guest’ if you have enable guest share in the
smb.conf - select the shares that you want to mount
- you can see the mounted directories in the finder
on iOS,
- open Files
- click on the three dots seen on the top right of the screen
- click on ‘Connect to Server’
- type in your machine’s IP address (smb://
) and proceed - type in the samba username and password when asked if you are a registered user. or click on ‘Guest’ if you have enable guest share in the
smb.conf - you can see the mounted shares under ‘Shared’ in the ‘Browse’ tab
on Windows,
- open Explorer
- type in your machine’s IP address (\\
) and press Enter - type in the samba username and password when asked
- you can see the shares now