Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

how to auto mount Samaba shares

Posted on 2003-03-30
9
Medium Priority
?
217 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
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Loops Section Overview

572 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