?
Solved

how to auto mount Samaba shares

Posted on 2003-03-30
9
Medium Priority
?
214 Views
Last Modified: 2010-03-17
I am running Redhat 7.3 with Samba 2.2.8. I want to set up Linux to auto mount a few shared windows directory. I have tried adding a line to /etc/fstab but this causes errors at boot as it is trying to mount before the network services are started. I heared this is a bad way to do it anyway as passwords are easily read. My question is how do I set up a start up script to mount multiple windows shares in a secure way? I have only been using Linux for about 3 weeks, so I have no idea how to set up a startup script.
Thanks.

0
Comment
Question by:Floopyb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 

Expert Comment

by:lungying
ID: 8239078
Hi floopyb, you can install webmin from the following website, go to the start the shutdown services under system, then add a line "mount /dev/hda1 ....." inside it.

http://www.webmin.com/webmin/
0
 
LVL 9

Expert Comment

by:tkalchev
ID: 8239244
Simply add the commands at the end of your /etc/rc.d/rc.local file :

....

mount //server1/share1 /mountpoint1 -o "user=username1,password=pwd1"
mount //server1/share2 /mountpoint2 -o "user=username2,password=pwd2"
and so on

It if as much secure as possible, if somebody can do and read your /etc/rc.d/rc.local file, your system is already dead :)


0
 
LVL 9

Expert Comment

by:tkalchev
ID: 8239253
Ops,
mount //server1/share1 /mountpoint1 -o "user=username1,password=pwd1"
mount //server1/share2 /mountpoint2 -o "user=username2,password=pwd2"

should be of course :
mount //server1/share1 /mountpoint1 -o "user=username1,password=pwd1" -t smbfs
mount //server1/share2 /mountpoint2 -o "user=username2,password=pwd2" -t smbfs
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Floopyb
ID: 8242243
Thanks, could I also use the smbmount command in rc.local? eg:
smbmount //server/share /mountpoint/ -o username=user%pass,fmask=664,dmask=775
This is a mountscript exported from LinNeighborhood. If i can is there any difference between the two commands?
0
 
LVL 9

Accepted Solution

by:
tkalchev earned 120 total points
ID: 8243771
It is absolutely one and the same, "mount -t smbfs" is calling internally smbmount and passing the -o options to it. So

smbmount //server/share /mountpoint/ -o username=user%pass,fmask=664,dmask=775

and

mount //server/share /mountpoint/ -o username=user%pass,fmask=664,dmask=775 -t smbfs

is one and the same
0
 

Author Comment

by:Floopyb
ID: 8250108
Thanks for the info, I tried both ways and they work perfectly:)
0
 
LVL 9

Expert Comment

by:tkalchev
ID: 8251715
Then myabe is a good idea to accept one of my comments as answer ...
0
 

Author Comment

by:Floopyb
ID: 8251742
Oh yeah, sorry, I'm new to this :)
0
 
LVL 9

Expert Comment

by:tkalchev
ID: 8251878
n.p. :)
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question