Setting up a Samba fileshare on the command line on Linux

linux, samba

Setting up a Samba fileshare on Linux (I prefer Ubuntu for myself) from the command line is simple enough and very easy to configure.

Create the folder, chmod the folder to full read and write settings and set the folder ownership to “nobody”. This should be OK as hopefully you’ll only have access to the shared folder on your local network.

Meanwhile, one line on the CLI will enable the file sharing settings:

net usershare add shared /home/yourhostname/somefolder/shared "yourhostname shared" everyone:F guest_ok=y

That should be it. You can then access the folder with no passwords and from any machine on the local network.

Confirm your settings are OK when running this command below:

root@yourhostname/home/somefolder/Desktop# net usershare info --long
[shared]
path=/home/yourhostname/Desktop/shared
comment=yourhostname shared
usershare_acl=Everyone:F,
guest_ok=y

Leave a Reply

Your email address will not be published. Required fields are marked *