nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Linux Shell script to mount remote windows share

This is a discussion on Linux Shell script to mount remote windows share within the Shell scripting forums, part of the Development/Scripting category; Dear how i can mount shared folder when my linux started i use the command line on my box HTML ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 09-05-2007, 07:59 PM
Junior Member
User
 
Join Date: Sep 2007
My distro: Debian
Posts: 8
Rep Power: 0
angelus_kit is on a distinguished road
Red face Linux Shell script to mount remote windows share

Dear

how i can mount shared folder when my linux started

i use the command line on my box

HTML Code:
mount.cifs //ip_adresse/MAIN /mnt/Bluecoatman/ -o username=myuser,dom=my domain    "inter"

pass :
can you learn me how i can create script

best regard

sorry for my poor English
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-06-2007, 04:33 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,036
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Method # 1
Here is the script:

Code:
#/bin/bash
SERVER_IP="10.10.1.5"
SHARE_NAME="c$"
USR_NAME="myusername"
USR_PASSWORD="mypassword"
DOMAIN="mydomain"
mount.cifs //$SERVER_IP/$SHARE_NAME -o username=$USR_NAME,password=$USR_PASSWORD,dom=$DOMAIN /mnt/Bluecoatman/
Add this script to /etc/rc.local file and reboot the system.

Method # 2
Open /etc/fstab file and append entry as follows:
Code:
vi /etc/fstab
Append code:
Code:
//ip_adresse/MAIN /mnt/Bluecoatman/      smbfs   username=myUser,password=myPassword,dom=myDomain 0 0
Close and save the file. Run command
Code:
mount -a
df -H
mount
cd /mnt/Bluecoatman
ls -l
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #3 (permalink)  
Old 09-06-2007, 08:18 PM
Junior Member
User
 
Join Date: Sep 2007
My distro: Debian
Posts: 8
Rep Power: 0
angelus_kit is on a distinguished road
Smile

hi

thank you for your replay, the second methode it"s work with

HTML Code:
//ip_adresse/MAIN /mnt/Bluecoatman/      cifs   username=myUser,password=myPassword,dom=myDomain 0 0
the firs methode i can' tt use it because i don't know how i can add the script in the rc.local

thank you for your help
Best Regard
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Automatic Mount of Windows Share bayvista Networking, Firewalls and Security 0 02-21-2008 12:07 PM
Shell script to perform operation on remote server vivekv Shell scripting 3 10-24-2007 01:10 AM
Shell script to check the disk space on remote systems vijayscripts Shell scripting 5 10-21-2007 07:29 PM
Shell script to monitor remote local http or port 80 amigo28 Shell scripting 1 02-12-2007 10:58 PM
Linux Howto to mount remote directories securely and easily chimu Linux software 1 07-29-2006 05:28 AM


All times are GMT +5.5. The time now is 07:48 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36