Accessing Windows Shared Folders From Linux
Accessing Windows shared folders from Linux involves using the Samba (SMB) protocol, which allows interoperability between Linux/Unix servers and Windows-based clients. Here’s a step-by-step guide to access Windows shared folders from a Linux machine:
Method 1: Using File Manager
Most modern Linux distributions come with file managers that support browsing SMB shares directly.
- Open your File Manager:
- For example, if you are using GNOME, open the Nautilus file manager.
- In KDE, use Dolphin.
- Connect to the Server:
- In Nautilus, go to
Other Locationsand entersmb://<windows_ip_address>/<shared_folder_name>. - In Dolphin, use the address bar and enter
smb://<windows_ip_address>/<shared_folder_name>.
- In Nautilus, go to
- Authentication:
- If the shared folder requires authentication, you will be prompted to enter your username and password.
Method 2: Using the Command Line
You can use the smbclient tool or mount the share using cifs filesystem.
Using smbclient (for browsing and accessing files)
- Install smbclient:
sudo apt-get install smbclient # Debian/Ubuntu sudo yum install samba-client # CentOS/RHEL sudo dnf install samba-client # Fedora - Access the Shared Folder:
smbclient //windows_ip_address/shared_folder -U username- Replace
windows_ip_addresswith the IP address of the Windows machine. - Replace
shared_folderwith the name of the shared folder. - Replace
usernamewith your Windows username.
- Replace
- Browse the Share:
- After entering your password, you will be in the smbclient interactive shell, where you can use commands like
ls,cd,get, andputto interact with files.
- After entering your password, you will be in the smbclient interactive shell, where you can use commands like
Using cifs (for mounting the share)
- Install cifs-utils:
sudo apt-get install cifs-utils # Debian/Ubuntu sudo yum install cifs-utils # CentOS/RHEL sudo dnf install cifs-utils # Fedora - Create a Mount Point:
sudo mkdir /mnt/windows_share - Mount the Share:
sudo mount -t cifs //windows_ip_address/shared_folder /mnt/windows_share -o username=windows_username,password=windows_password,workgroup=WORKGROUP- Replace
windows_ip_addresswith the IP address of the Windows machine. - Replace
shared_folderwith the name of the shared folder. - Replace
windows_usernameandwindows_passwordwith your Windows credentials. - Replace
WORKGROUPwith your network workgroup name if different.
- Replace
- Access the Mounted Share:
- Now you can access the shared folder at
/mnt/windows_share.
- Now you can access the shared folder at
- Unmount the Share:
sudo umount /mnt/windows_share
Method 3: Permanent Mount via fstab
- Edit fstab File:
sudo nano /etc/fstab - Add an Entry:
//windows_ip_address/shared_folder /mnt/windows_share cifs username=windows_username,password=windows_password,workgroup=WORKGROUP,iocharset=utf8,sec=ntlm 0 0 - Mount All Filesystems:
sudo mount -a- This ensures the shared folder is mounted automatically at boot.
By following these steps, you should be able to access Windows shared folders from your Linux machine easily.
Enjoy Reading This Article?
Here are some more articles you might like to read next: