CUPS / Samba / Wireless Printing randomly stops working on Ubuntu

CUPS, linux, samba

I’ve setup a CUPS (Common Unix Printing System) wireless printer sharing in our office, and occasionally the wireless printing randomly stops working. In addition, Samba also stops for file sharing. This kind of behaviour is normally coupled with the LAN/Wireless connection dropping, so you cannot even SSH into the machine itself.

There is no need to restart the computer, just restart the network-manager from the machine itself.

sudo service network-manager restart

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