Mapping network drives at the command line - Ubuntu vs Windows

Posted in software by Christopher R. Wirz on Sun Apr 15 2012

Assume we've already created a SAMBA share with the following:

  • the server IP address is "192.168.0.10" as found using ifconfig
  • the name of the shared folder is "Data"

Let's assume the following credentials:

  • the workgroup is "WORKGROUP" by default
  • the account is "myusername"
  • the password is "mypassword"

net use R: \\192.168.0.10\Data mypassword /USER:WORKGROUP\myusername /PERSISTENT:Yes

Mapping in linux adds an additional step. Instead of having drives, Ubuntu uses a directory system. Therefore, in order to map a network share, you must first create a directory to map to. Additionally, you have to have cifs-utils installed.

sudo apt-get install cifs-utils
mkdir Data
sudo mount -t cifs -o username=WORKGROUP\myusername -o password=mypassword //192.168.0.10/Data Data

What's next? Now you can make a linux network share and map it from Windows or another linux machine.

Looking for a job?