Access Windows Shares From BASH In Linux

View previous topic View next topic Go down

Access Windows Shares From BASH In Linux

Post by jamied_uk on 25th November 2016, 18:04

Vid


First you need to have samba installed.
Code:
sudo apt-get install samba

Then use a Bash script to mount windows share folder in linux using samba:

Code:
mkdir /mnt/smb

touch smb.sh

chmod +x smb.sh

sudo gedit smb.sh

Write the following into the smb.sh file using vi vim or gedit:

Code:
#/bin/bash



SERVER_IP="192.168.0.3"

SHARE_NAME="c$"

USERNAME="jay"

PASSWD="samba password"

DOMAIN="domain"


mount.cifs //$SERVER_IP/$SHARE_NAME -o username=$USERNAME,password=$PASSWD,dom=$DOMAIN

/mnt/smb/

Finally run the script to mount your Windows share and cd into the share:

Code:
./smb.sh

cd /mnt/smb/
avatar
jamied_uk
Admin

Posts : 2296
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum