Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SMB + /etc/fstab + bind = pain
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
8-bitDesigner
n00b
n00b


Joined: 14 Jan 2006
Posts: 25
Location: Orange, CA

PostPosted: Mon Jul 03, 2006 10:57 am    Post subject: SMB + /etc/fstab + bind = pain Reply with quote

Well, not so much pain, as a whole lot of annoying. Anyways, I've got an FTP server set up, and as its pretty skimpy on the internal hard drive space, most of the files it serves are from samba shares on the computer next to it.

Not horribly efficient, but it works.

Now, the way this is set up is via a series of smbfs entries in /etc/fstab, which mounts my remote shares. However, immediately after the smbfs lines, I have a series of bind commands to bind the newly mounted share, to a folder inside my /home/ftp directory.

This, unfortunately doesn't work when I restart my system, and I'm wagering this is because internal mounts are handled first (including my bind commands) and external mounts are handled later in the process.

Is there any easy way to handle this, short of writing a bash script to handle these bind commands on boot?

Here's the pertinent snippet from /etc/fstab

Code:

//remote_pc/share        /mnt/share      smbfs           defaults,username=paul,password=xxxxxx      0 0

/mnt/share              /home/ftp/share none            rw,bind         0 0


Last edited by 8-bitDesigner on Mon Jul 03, 2006 9:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
xenoscr
Tux's lil' helper
Tux's lil' helper


Joined: 08 Dec 2003
Posts: 123
Location: Indianapolis, IN

PostPosted: Mon Jul 03, 2006 9:06 pm    Post subject: Reply with quote

Is there a reason that you are trying to bind /mnt/share to /home/ftp/share instead of using symlink?

Also, I would recomend looking into using a credentials file for your SMB username and password instead of putting that information in your /etc/fstab file. You can limit the access the the credential file to root and root alone so prying eyes can not see your SMB ID and password.

Your fstab line would look like:
Code:
//remote_pc/share        /mnt/share      smbfs           defaults,credentials=/etc/smbidfile      0 0


And the /etc/smbidfile would contain:
Code:
username=smbuserid
password=smbpassword


You would then chmod root:root /etc/smbidfile and chown 600 /etc/smbidfile and your ID and Pasword are now safe.

XeNoS
Back to top
View user's profile Send private message
8-bitDesigner
n00b
n00b


Joined: 14 Jan 2006
Posts: 25
Location: Orange, CA

PostPosted: Mon Jul 03, 2006 9:11 pm    Post subject: Reply with quote

Hey, thanks for the heads-up on the credentials file. I might want to try that out, and totally forgot to vet that from the post. ;)

I don't believe ProFTPd follows symlinks, which more or less leaves you with binds as your only option for directories.
Back to top
View user's profile Send private message
xenoscr
Tux's lil' helper
Tux's lil' helper


Joined: 08 Dec 2003
Posts: 123
Location: Indianapolis, IN

PostPosted: Mon Jul 03, 2006 9:52 pm    Post subject: Reply with quote

Sorry I can't help with the bind thing, never tried it, but if the credentials thing helps, I did some good. :D

XeNoS
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum