docs

a slatepencil documentail site

View on GitHub

samba

install

sudo apt update
sudo apt install samba
# We can check if the installation was successful by running:
whereis samba
# samba: /usr/sbin/samba /usr/lib/samba /etc/samba /usr/share/samba /usr/share/man/man7/samba.7.gz /usr/share/man/man8/samba.8.gz

config

mkdir /mnt/ssd/sambashare/
sudo nano /etc/samba/smb.conf

[sambashare]
    # comment: A brief description of the share
    comment = Samba on Ubuntu
    # path: The directory of our share.
    path = /home/username/sambashare
    # read only: Permission to modify the contents of the share folder is only granted when the value of this directive is no.
    read only = no
    # browsable: When set to yes, file managers such as Ubuntu’s default file manager will list this share under “Network”
    browsable = yes

sudo service smbd restart
sudo ufw allow samba
# Setting up User Accounts and Connecting to Share
# “-a”: This flag adds the existing Unix/linux user to the Samba user database.
sudo smbpasswd -a username
# Username used must belong to a system account, else it won’t save.

server address

# ubuntu & macos
smb://ip-address/sambashare
# windows
\\ip-address\sambashare

password

# First check if current user account already exists among smbdclients:
sudo pdbedit -L
# if the account is not there just run
sudo smbpasswd -a myaccount
# otherwise if already exists, you have to delete first and recreate a new one:
sudo pdbedit -x -u myaccount 
sudo smbpasswd -a myaccount