Difference between revisions of "Installing Samba from the command line"

From Da Nerd Mage Wiki
Jump to navigation Jump to search
Line 10: Line 10:
Basic Samba install & minimal configuration
Basic Samba install & minimal configuration


Create a test folder & file to be shared. (Assuming you'll replace '''USER''' with your own username...)
= Create a test folder & file to be shared. =
(Assuming you'll replace '''USER''' with your own username...)
* <code>mkdir ~/share</code>
* <code>mkdir ~/share</code>
* <code>touch ~/share/Foo</code>
* <code>touch ~/share/Foo</code>
Install Samba
 
= Install Samba =
* <code>sudo apt install samba -y</code>
* <code>sudo apt install samba -y</code>
Configure the test share
 
= Configure the test share =
* <code>sudo vi /etc/samba/smb.conf</code>
* <code>sudo vi /etc/samba/smb.conf</code>
  [New_share]
  [New_share]
     comment= my share
     comment= my share
Line 24: Line 26:
     Read only = no
     Read only = no
     guest  ok = no          ; Change to 'yes' to allow anonymous access
     guest  ok = no          ; Change to 'yes' to allow anonymous access
* <code>sudo systemctl restart smbd</code>


* <code>sudo systemctl restart smbd</code>
= Set up usernames & passwords for Samba acess =
Set up usernames & passwords for Samba acess (Samba uses it's own password list.&nbsp; Therefore, you'll need to set up each user...)
(Samba uses it's own password list.&nbsp; Therefore, you'll need to set up each user...)


For each user that will be allowed access ('''USER'''s must exist as users on the system),
For each user that will be allowed access ('''USER'''s must exist as users on the system),
* <code>sudo smbpasswd -a '''USER'''</code>
* <code>sudo smbpasswd -a '''USER'''</code>
Additional bits to install (Client & utils & such...)
 
= Additional bits to install =
(Client & utils & such...)
* <code>sudo apt install cifs-utils samba-client -y</code>
* <code>sudo apt install cifs-utils samba-client -y</code>
= 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.
'''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.



Revision as of 18:37, 18 January 2022

Proven on:
Logo Debian.png
11 (bullseye)


Basic Samba install & minimal configuration

Create a test folder & file to be shared.

(Assuming you'll replace USER with your own username...)

  • mkdir ~/share
  • touch ~/share/Foo

Install Samba

  • sudo apt install samba -y

Configure the test share

  • sudo vi /etc/samba/smb.conf
[New_share]
    comment= my share
    path = /home/USER/share
    browseable  = yes
    Read only = no
    guest  ok = no          ; Change to 'yes' to allow anonymous access
  • 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...)

  • 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.