Difference between revisions of "Installing Samba from the command line"
Jump to navigation
Jump to search
Line 33: | Line 33: | ||
'''Note:''' Files & folders placed in this share by an anonymous user will belong to '''nobody:nogroup'''. | '''Note:''' Files & folders placed in this share by an anonymous user will belong to '''nobody:nogroup'''. | ||
:oddly, even as the owner of the share, you won't have direct control over these files/folders. | |||
:So, it might be a good idea to add yourself to the '''nogroup''' group: | |||
:* <code>sudo usermod -a -G nogroup '''USER'''</code> | |||
== As a share requiring authentication == | == As a share requiring authentication == |
Revision as of 15:56, 19 January 2022
11 (bullseye) |
|
Basic Samba install & minimal configuration
(Assuming you'll replace USER with your own username...)
mkdir ~/share
touch ~/share/Foo
Install Samba
sudo apt install samba -y
sudo vi /etc/samba/smb.conf
[New_share] comment= my share path = /home/USER/share force create mode = 0660 ; readable and writable by user and group force directory mode = 0770 ; readable, writable and searchable by user and group browseable = yes Read only = no guest ok = yes
Note: Files & folders placed in this share by an anonymous user will belong to nobody:nogroup.
- oddly, even as the owner of the share, you won't have direct control over these files/folders.
- So, it might be a good idea to add yourself to the nogroup group:
sudo usermod -a -G nogroup USER
[New_share] comment= my share path = /home/USER/share browseable = yes Read only = no guest ok = no
Restart Samba
While you're in there, if you don't have printer(s) connected to the machine, comment out or remove the [printers] and [print$] blocks
sudo systemctl restart smbd
Set up usernames & passwords for Samba acess
(Samba uses it's own password list. Therefore, you'll need to set up each user...)
For each user that will be allowed access (USERs must exist as users on the system),
sudo smbpasswd -a USER
Additional bits to install
Client & utils & such... (optional)
sudo apt install cifs-utils samba-client -y
Usage Notes
NOTE: At this point, the share can be accessed, but you need to know where it is because Samba does not advertise it's presence.
- You can see the shares from the machine by entering
smb://MACHINENAME/
into the address bar of your file browser.