Friday, October 17, 2014

Mount windows shared folder in linux

On Windows

If no folder is shared, share a folder on windows machine by running
C:\> net share toLinux=c:\shared\toLinux /grant:windows-login-id,read
 Verify if the share is visible
C:\> net share

On SuSE

If mount.cifs is not installed, install it by running
$ zypper install cifs-utils 
Create a mount point for mounting the shared folder by running
$ mkdir /mnt/fromWindows 
Now, mount the Windows shared folder on Linux by running below command and provide password when prompted
$ mount -t cifs -o username=windows-login-id windows-host:/toLinux /mnt/fromWindows 
Verify if the mount is listed by running
$ mount 
If successfully mounted, the files from Windows folder c:\shared\toLinux can be accessed in Linux folder /mnt/fromWindows
$ ls /mnt/fromWindows

On Ubuntu

Substitute these commands in the respective places of above section, On SuSE.
 
$ apt-get install cifs-utils 
 
$ mkdir /mnt/fromWindows 
 
$ mount -t cifs -o username=windows-login-id //windows-host/toLinux /mnt/fromWindows 
 
$ mount 
 
$ ls /mnt/fromWindows

No comments: