How to setup Linux server as a file server

Pratyaydeep Chanda 1 Reputation point

I would like to know how can I setup an ubuntu server as a file server. Please note I am aware of using azure files where we can setup a SMB file share. But apart from that, let's say I would like to directly access my ubuntu file share via its hostname. Here is an example to explain my scenario:

  1. I have created a directory called /shared/documents in my ubuntu server (vmcompass) which I would to share with everyone.
  2. Created a mount point called /mnt/documents to mount my shared location there.
  3. Added an entry in /etc/fstab file for auto mount, like below:

// /mnt/documents cifs username=myuser,noauto 0 0

However while mounting the SMB share I am getting the below error. I am not sure what is wrong ?

sudo mount /mnt/documents
Password for myuser@//vmcompass/shared/documents: ********
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
4,608 questions
{count} votes