How to Mount a Windows Share In Linux
By vashal
Before We Start
Before we can mount a share, Samba must be enabled and configured on your Linux computer. Samba is what allows Linux to access shared folders on a Windows machine. Without it, you won't be able to access Windows shares.
Mounting a Windows Share in Linux
There are a couple of different methods for mounting your share, depending on the version of Windows you are attempting to connect to. CIFS is the protocol we will use to access network shares on newer Windows machines. For older Windows computers, we will use SMB.
The basic syntax we will use is as follows:
mount -t [protocol] //ServerName/ShareName /mnt -[options]
[Protocol] will be replaced with either "cifs" or "smb" (both without quotes) depending on the Windows computer you are connecting to. [Options] can include a username and password that have the necessary permissions to access the Windows share. Note that "mnt" is the folder that the share will be mounted to. It can be set to any name you like in any location within Linux, but the folder must exist before you run the command.
"ServerName" is the hostname of the Windows computer you are accessing, and "ShareName" is the name the folder is shared as in Windows.
Here is an example of using the above command to connect to a share on a Windows XP machine:
mount -t cifs //ServerName/ShareName /mnt -ouser=administrator,password=password
Windows XP is OS, so we are using CIFS as the protocol to connect to. The "ouser" option specifies the username of the Windows computer you are using to connect, and "password" is the password for that same account. Note that if you use the "password" option you will be typing the password in plain text onto the terminal. This can be avoided by excluding the "password" option, which will cause Linux to prompt you for the password in a protected field.
For example, typing:
mount -t cifs //ServerName/ShareName /mnt -ouser=administrator
Will prompt you for administrator's password. The password won't be shown on the screen.
More From This Author
- How To Start The Hyperic HQ Server And Agent Service At Startup With Linux
This tutorial assumes that you already have Hyperic HQ software unpacked and installed on your system. Further, it assumes that you created a user named "hyperic" to install the software. If you used a different user, you'll need to edit the script... - 4 months ago
- How To Run Fitnesse As A Windows Service
Fitnesse, like many Java applications, doesn't come with an installer package for Windows. It doesn't automatically itself as a Windows service, so it doesn't automatically start when your system boots up. Fortunately, we can set it up as a service... - 4 months ago
- How to Mount a Windows Share In Linux
Before we can mount a share, Samba must be enabled and configured on your Linux computer. Samba is what allows Linux to access shared folders on a Windows machine. Without it, you won't be able to access Windows shares. There are a couple of... - 4 months ago
- Set File Permissions In Unix With The chmod Command
File permissions in Unix are a bit different from Windows. When we set the permissions for a file, we will be granting access to three different entities: user, group, and other. The user is whichever specific user owns the file. The group is the... - 14 months ago
- iPad 2 Revealed: Here Are The Details
The original iPad is a tablet computer released by Apple in 2010. It offered a number of options for Internet connectivity, a 10 inch screen, and an app store loaded with an ever-increasing number of applications for download, both free and... - 14 months ago
Comments
No comments yet.