PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Access Windows Shares From BASH In Linux

Go down

Access Windows Shares From BASH In Linux Empty Access Windows Shares From BASH In Linux

Post by jamied_uk 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/
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Back to top

- Similar topics

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