set up Samba for file-sharing

A very basic smb.conf file will look like this:
 [global]
    workgroup = MYGROUP
    server string = Samba Server Version %v
    log file = /var/log/samba/log.%m
    max log size = 50
    security = user
    passdb = tdbsam
[homes]
    comment = Home Directories
    browseable =no
    writable = yes
This is an absolutely basic configuration file. If you already have a workgroup defined, change the “workgroup” value to whatever you have already defined for the network. The rest can remain as-is. This will allow you the ability to connect to the server and mount your home directory on the server from any other machine on the network.
The next step is to create the local passwords. Because Samba does not use the authentication credentials of the system (i.e., via PAM), you need to add the user to the Samba user database:
# smbpasswd -a user
Provide the password for the user in question. Also note that this user must also exist on the system, so if this is a new user you must use useradd to create the user and passwd to set their password. If the user already exists on the server, there is no need to do anything more than set their Samba password.
Once this is all complete, start the Samba server (or restart it):
# service smb start
Now, from another system, you can use smbclient to list available shares:
% smbclient -L \\server.myhost.com
Password:
Domain=[CERBERUS] OS=[Unix] Server=[Samba 3.5.4-62.fc13]
       Sharename       Type      Comment
       ---------       ----      -------
       IPC$            IPC       IPC Service (Samba Server Version 3.5.4-62.fc13)
       user            Disk      Home Directories
Domain=[CERBERUS] OS=[Unix] Server=[Samba 3.5.4-62.fc13]
       Server               Comment
       ---------            -------
       Workgroup            Master
       ---------            -------
To mount the share, connect to \\server.myhost.com\user using the network browser in GNOME, the Finder in OS X, or Windows Explorer in Windows.
This is the easiest way to set up Samba for file sharing. Other mechanisms exist for sharing files on a LAN, such as NFS or SSHFS, but Samba is quick, easy to set up, and reliable. It is also cross-platform, making it easy to share files amongst various operating systems.

 

Comments

Popular posts from this blog

Running web ssh client on port 443 /80 with nginx as reverse proxy

Running cockpit behind nginx reverse proxy with nginx ssl and cockpit non ssl

Setup VOD streaming server with nginx using RTMP on Ubuntu 18.04