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:
1 | mount -t cifs //192.168.1.1/mySharedFolder -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.
//192.168.1.1/mySharedFolder : 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:
1 | cd /mnt/mySharedFolder |
2 | ls -la |
//192.168.1.1/mySharedFolder /mnt/mySharedFolder cifs username=myUser,password=myPassword 0 0
Replace //192.168.1.1/mySharedFolder, myUser and myPassword with your actual parameters.
No comments:
Post a Comment