Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-15-2006, 11:22 PM
|
#1
|
Senior Member
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Rep:
|
How to mount SAMBA shares in /etc/fstab automatically?
Currently I have this in my /etc/fstab
//192.168.0.3/accounting /mnt/accounting smbfs username=john,password=XXXXXX uid=500,gid=512 0 0
basically when the computer boots up, I want the /mnt/accounting to be available on the workstation. Unfortunately, this isn't happening when the users log onto the computer. Is there something I am missing in the /etc/fstab?
Also, how do you encrypt the username/password in the fstab? It's in plaintext.
|
|
|
06-15-2006, 11:45 PM
|
#2
|
Member
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Rep:
|
You need to add the option "auto" for it to mount at boot also try credentials=/path/to/file and put a username and pass in the form of:
username = <value>
password = <value>
then chmod 600 the file, then mount will read the user and pass from the file which can only be viewed by root. That's the only way to "hide" the pass.
|
|
|
06-16-2006, 12:31 AM
|
#3
|
Senior Member
Registered: Sep 2003
Posts: 1,091
Rep:
|
I dont think the network is started when the drives from fstab are mounted. So it would be hard to map network drives without a network available  Your best bet will be to create startup scripts that mount them. You can leave them in fstab and just make a simple script.. mount /my/smbshare
|
|
|
06-16-2006, 12:49 AM
|
#4
|
Member
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Rep:
|
I was thinking that also.
But why have the option to put it in fstab if networking isn't loaded ??? but oh well.
the script would look something like:
Code:
smbmount //192.168.0.3/accounting /mnt/accounting -o uid=500,gid=512,credentials=/root/.smbfile
I don't use smb enough to want it to mount automatically anyway, and since I put SSH on the only win box in the net I just use fish://
|
|
|
06-16-2006, 01:05 AM
|
#5
|
Senior Member
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Original Poster
Rep:
|
Thanks for the quick replies! I tried adding auto to the end of my line, but it still didn't work. Probably like you said about the network not being loaded yet so it's pointless.
I can create a mount script, but where do I put it to start up with the rest of the system?
|
|
|
06-16-2006, 01:23 AM
|
#6
|
Member
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Rep:
|
If your using debian based put the script in /etc/init.d/
then run:
update-rc.d [name of script] start 40 2345
eg if the script was called shares,
update-rc.d shares start 40 2345
|
|
|
06-16-2006, 05:16 AM
|
#7
|
LQ Newbie
Registered: Jun 2006
Posts: 1
Rep:
|
can any one tell me to install a linux system through PXE.
|
|
|
06-16-2006, 05:24 AM
|
#8
|
Member
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Rep:
|
Quote:
can any one tell me to install a linux system through PXE.
|
if your asking a question that isn't related to this thread please start a new one, and give more information that that so we know what you mean
|
|
|
All times are GMT -5. The time now is 03:18 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|