android bsd linux unix & open-source world


Linux: How to mount SMB/CIFS shares under Linux

WP Greet Box icon
Hello there! If you are new here, you might want to subscribe to the RSS feed or subscribe via E-mail for updates on this topic.

This document provides help on mounting SMB/CIFS shares under Linux.
All files accessible in a Linux and UNIX systems are arranged in one big tree, the file hierarchy, rooted at /. These files can be spread out over several devices. The mount command serves to attach the file system found on some device to the big file tree.

Use the mount command to mount remote SMB/CIFS shares under Linux as follows:

mount -t cifs // -o username=myUser,password=myPassword /mnt/mySharedFolder

-t cifs : File system type to be mount
-o : are options passed to mount command, in this example I had passed two options. First argument is the user name (myUser) and second argument is the password (myPassword) to connect to the remote computer.
// : remote computer and share name
/mnt/mySharedFolder : local mount point directory

Make sure to create /mnt/mySharedFolder first.

Once this happens you can change to the directory and view the contents using cd and ls command:

cd /mnt/mySharedFolder
ls -la

To mount a SMB/CIFS share to be mounted when a Linux system comes up after reboot edit the /etc/fstab file and an entry as follows:

// /mnt/mySharedFolder cifs username=myUser,password=myPassword 0 0

Replace //, myUser and myPassword with your actual parameters.

Print This Post Print This Post
Comments (1) Trackbacks (0)

Leave a comment


No trackbacks yet.