LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 06-15-2006, 11:22 PM   #1
Micro420
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: Reputation: 45
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.
 
Old 06-15-2006, 11:45 PM   #2
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
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.
 
Old 06-16-2006, 12:31 AM   #3
trey85stang
Senior Member
 
Registered: Sep 2003
Posts: 1,091

Rep: Reputation: 41
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
 
Old 06-16-2006, 12:49 AM   #4
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
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://
 
Old 06-16-2006, 01:05 AM   #5
Micro420
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: Reputation: 45
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?
 
Old 06-16-2006, 01:23 AM   #6
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
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
 
Old 06-16-2006, 05:16 AM   #7
dip_3131
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
can any one tell me to install a linux system through PXE.
 
Old 06-16-2006, 05:24 AM   #8
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
automatically mount NFS shares turbo_acura Linux - Networking 1 10-28-2004 05:33 PM
Why a FSTAB entry will mount using -a switch but will not mount automatically at boot mjen Linux - Newbie 3 05-19-2004 07:45 AM
using fstab to mount windows xp shares yeateke Linux - Networking 4 03-01-2004 08:19 AM
Linux can mount samba shares but not windows shares bindsocket Linux - Software 1 12-01-2003 05:28 PM
Automatically mount file shares? odious1 Linux - Newbie 1 07-03-2003 01:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration