Created
March 9, 2012 07:51
-
-
Save bilalhusain/2005565 to your computer and use it in GitHub Desktop.
mount network drive on linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USER=bilal | |
DOMAIN=localnetwork.com | |
LOCAL_LOCATION=/home/bilal/networkStorage | |
REMOTE_LOCATION=//{IP_ADDRESS}/{DIRECTORY} | |
sudo mount -t smbfs -o username=$USER,domain=$DOMAIN $REMOTE_LOCATION $LOCAL_LOCATION | |
echo -e "to unmount:\n\tsudo umount $LOCAL_LOCATION" | |
# troubleshooting: | |
# ensure smbfs installed (sudo apt-get install smbfs) | |
# $MACHINE_NAME = `hostname -s` | |
# ensure /etc/hosts contains | |
# 127.0.1.1 $MACHINE_NAME.$DOMAIN | |
# ensure /etc/hostname contains | |
# $MACHINE_NAME.$DOMAIN | |
# tip: change password | |
# smbpasswd -r $DOMAIN -U $USER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment