How to Mount a Windows Network Share in Linux (Easy & Permanent)

windows to linux mount guide

Mount Linux (SMB/CIFS) from Windows or NAS

Quick Answer: To mount a Windows share on Linux, install cifs-utils, create a mount point, store credentials securely, and run a mount -t cifs command.

Quick Steps ⚡

  1. Install CIFS tools
  2. Create a mount directory
  3. Create a credentials file
  4. Run the mount command
  5. (Optional) Add to fstab for auto-mount

Step 1: Install Required Package 🔧

sudo apt update
sudo apt install cifs-utils

On RHEL/CentOS/Fedora:

sudo dnf install cifs-utils

Step 2: Create a Mount Point 📁

You may name the “network-drive” whatever you prefer as long as you use the name consistently in following steps.

sudo mkdir -p /mnt/network-drive

Step 3: Create Credentials File 🔐

nano ~/.smbcredentials

Add: Use your case sensitive logon credentials

username=your_username
password=your_password

Secure it:

chmod 600 ~/.smbcredentials

Step 4: Mount the Windows Share 🔗

You must have your server IP Address and file path for this step.

sudo mount -t cifs //SERVER_IP/SHARE_NAME /mnt/network-drive \
-o credentials=~/.smbcredentials,vers=3.0

Example:

sudo mount -t cifs //192.168.1.143/shared-folder /mnt/network-drive \
-o credentials=~/.smbcredentials,vers=3.0

Step 5: Verify the Mount ✅

df -h

or

ls /mnt/network-drive

Auto-Mount on Boot (fstab) ♻️

sudo nano /etc/fstab

Add:

//SERVER_IP/SHARE_NAME /mnt/network-drive cifs credentials=/home/YOUR_USER/.smbcredentials,_netdev,vers=3.0 0 0

Apply:

sudo mount -a

Troubleshooting ⚠️

Permission Denied

  • Check username and password
  • Verify Windows share permissions

Mount Error (95)

vers=2.1

Host is Down

  • Check network connection
  • Verify server IP

Security Best Practices 🔒

  • Use a credentials file (never plain text in command)
  • Set permissions to 600
  • Avoid storing credentials in root unless necessary

FAQ ❓

What is CIFS in Linux?

CIFS (Common Internet File System) is the protocol used to access Windows shared folders from Linux systems.

Do I need sudo to mount a Windows share?

Yes, mounting typically requires root privileges unless configured otherwise.

How do I auto-mount a network drive in Linux?

Add the mount entry to /etc/fstab with the _netdev option.

Why is my SMB mount failing?

Common causes include missing cifs-utils, incorrect credentials, wrong SMB version, or network issues.

Summary 🧠

Mounting a Windows share on Linux involves installing CIFS tools, creating a mount point, securely storing credentials, and running a mount command. For persistent setups, configure fstab.


The following information are the same steps in a different visual format in order to help readers fully understand if there is something you missed in the guide above.
We do this because sometimes just looking at something from a different angle is all it takes to light the bulb and complete the task.

Quick Easy No Fluff Network Mount Steps

This simple guide shows the cleanest way to mount a Windows shared folder or NAS(Network Attached Storage) share so it appears like a normal folder on your Linux desktop.

As a lifelong Windows user now running Linux on my spare computer for AI self hosting, I have run into many problems and this was one of them.
When trying to connect to the smb:// file share it was rejecting my username and password that I was positive was right. After following all of these steps it did work.

I am using Linux Mint(Mate) and ran into countless issues doing such a simple task so after I figured it all out, I made this easy to follow copy-paste guide for you.

Step 1: Create a Secure Credentials File

Your going to need to pass the login credentials from your Linux computer to your Windows PC or Network Attached Storage so make sure you know your username and password. Now we create a file with that information.

Open your Linux terminal and run these commands one by one:

REPLACE! YOUR_WINDOWS_USERNAME and YOUR_WINDOWS_PASSWORD with your actual Windows login details.

nano ~/.smbcredentials
username=YOUR_WINDOWS_USERNAME
password=YOUR_ACTUAL_PASSWORD
chmod 600 ~/.smbcredentials

Step 2: Create the Mount Point and Mount the Share

Now we will mount the network drive.

First, find the IP address of your Windows computer or Network Attached Storage (run ipconfig on Windows and note the IPv4 address).

Server-Path You will get the true IP Address and Server-Path to put here.
Drive-Name: You get to make this one up for your local Linux mounted drive. Drive-Name Must remain constant in following steps.

sudo mkdir -p /mnt/Drive-Name
sudo apt install cifs-utils
sudo mount -t cifs //192.168.1.XX/Server-Path /mnt/Drive-Name \
  -o credentials=~/.smbcredentials,vers=3.0

Test it:

ls /mnt/Drive-Name

Step 3: Create a Desktop Shortcut

The easiest way:

  1. Open your file manager and go to /mnt/Drive-Name
  2. Hold down Ctrl + Shift keys
  3. Click and drag from inside the Drive-Name folder onto your desktop
  4. Choose “Link Here” when prompted

To change the icon:

  • Right-click the new shortcut on your desktop → Properties
  • Click the small icon at the top-left
  • Choose a better icon (e.g., folder-remote or any you like)

Step 4: Make It Mount Automatically on Boot (Optional but Recommended)

Edit the fstab file:

sudo nano /etc/fstab

Add this line at the very bottom:

//192.168.1.XX/Server-Path /mnt/Drive-Name cifs  credentials=/home/$(whoami)/.smbcredentials,vers=3.0,_netdev,nofail,x-systemd.automount  0  0

Save and exit (Ctrl+O → Enter → Ctrl+X in nano).

Test the fstab entry:

sudo mount -a

If no errors appear, you’re done. The share will now mount automatically after every reboot.

Tip: Bookmark this page because you will probably have to mount more than one drive in your Linux career and there is no way you will remember all of those complex commands.

Done! You now have a clean desktop shortcut to your Windows or Network share that behaves like a normal folder.

windows mounted on linux pc

Leave a Comment

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

Scroll to Top