LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-03-2002, 11:42 AM   #1
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Rep: Reputation: 31
Question Automating Linux/Win file sharing on startup


I can successfully connect to Linux and Windows shares using Samba and LinNeighborhood, which is a cool little app that emulates the Windows Network Neighborhood environment. The problem is trying to automate my Linux box to mount the shares automatically on startup. I created a smbmount script for each share and added them to my rc.local file, but I see errors flying by during bootup and it doesn't work. Maybe I'm using the wrong file for this (another rc file?), or the wrong syntax? Please help if you can. Here's the syntax I'm using:

smbmount //<server>/<domain> /mnt<server>/<domain> -o username=<user>%<password>,fmask=644,dmask=755,uid=0,gid=0,ip=<server_IP>,debug=0,workgroup=<group>, port=139

Thanks very much in advance!
 
Old 07-03-2002, 12:00 PM   #2
MartBrooks
Member
 
Registered: May 2002
Location: London
Distribution: Debian
Posts: 388

Rep: Reputation: 31
Add the mounts you want to /etc/fstab

Regards
 
Old 07-03-2002, 02:48 PM   #3
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
Thanks for your advice.
I tried adding the above lines to my fstab, and I assume this is the wrong entry format, as it didn't work. I also tried the following format, which didn't work either:
mount -t smbfs -o user=<user>,passwd=<password> //<server>/<dir> /<local>/<dir>

Both returned boot log errors of "bad format".
What is the proper entry format for auto-mounting Samba shares in /etc/fstab ?
Thank you!
 
Old 07-05-2002, 09:47 AM   #4
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
Quote:
Originally posted by deesto
Thanks for your advice.
I tried adding the above lines to my fstab, and I assume this is the wrong entry format, as it didn't work. I also tried the following format, which didn't work either:
mount -t smbfs -o user=<user>,passwd=<password> //<server>/<dir> /<local>/<dir>

Both returned boot log errors of "bad format".
What is the proper entry format for auto-mounting Samba shares in /etc/fstab ?
Thank you!
In case anyone's interested, I solved my problem by moving the "mount" command above from fstab to /etc/rc.d/rc.local
It works just fine now.
Thanks.
 
Old 07-05-2002, 09:56 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
no, that's a poor solution, not advised

if you read the man page for fstab you'd be able to easily convert your mount command to:

//<server>/<domin> /mnt<server>/<domain> username=<user>,password=<password>,etc,etc,etc

i'm not too sure that all those options you use are really taht valid. the file and directory mask should really be defined on the server side, not locally and so forth.
 
Old 07-05-2002, 01:27 PM   #6
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
Quote:
Originally posted by acid_kewpie
i'm not too sure that all those options you use are really taht valid. the file and directory mask should really be defined on the server side, not locally and so forth.
Thanks Chris. Could you please explain this comment? How do I define these on the "server side"?
 
Old 07-05-2002, 02:06 PM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well in smb.conf you would set "directory mask = 022" or whatever. these options are listed in the smb.conf man page.. oh that's if you're sharing from linux.. which you're probably not are you? ahh that'll not be possible from windows... DOH!
 
Old 07-05-2002, 04:05 PM   #8
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
Actually, I'm doing both... let me explain.
I have a network with one Win2K box, one WinXP box, and two Linux RH 7.3 boxes, one of which is very old and I'm trying to set up as a non-GUI server, and the other is a little newer system w/KDE that I'm working on right now. Since I only have one monitor for the two Lin boxes (and a very bad KVM switch), I'm using SSH from this box to administer the Linux "server". Sharing between the two Linux boxes and the Win2K box is my main concern.
I added the lines above to my /etc/fstab on this box. This easily mounted the Win2K shares on this Linux box, no problem. The problem seems to be getting the right syntax for mounting the other Linux box's shares to this box. I added a similar line for this purpose, but the shell spit back a ton of errors during boot. Is the syntax different when trying to mount another Linux file system?
And if/when I ever figure this out, the next step is trying to print form this Linux box to the printer attached to the Win2K box... I'm at the end of my rope on that one.
 
Old 07-07-2002, 02:06 PM   #9
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
Anyboy know a quick way to script/automount a linux share on a Windows 2000 box? I have mapped the Linux share as a W2K drive, but I would like to automate the username/password combo so I don't get a prompt for the password each time I boot.
 
Old 07-17-2002, 06:27 PM   #10
nuzzy
Member
 
Registered: Aug 2001
Location: New Hampshire, USA
Distribution: Ubuntu 6.06 LTS
Posts: 204

Rep: Reputation: 31
Did you get your windows 2k mounting issue solved? You can creat a "startup.bat" file the mounts your shares and add it to the user or domain you want it to start up on...
 
Old 07-18-2002, 06:24 AM   #11
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
Quote:
Originally posted by nuzzy
Did you get your windows 2k mounting issue solved? You can creat a "startup.bat" file the mounts your shares and add it to the user or domain you want it to start up on...
No, I haven't, and that's exactly what I need to do! What is the syntax for adding a network share, user name, password, and Windows "drive" letter to a start-up .BAT file?
Thank you!
 
Old 09-11-2002, 12:59 PM   #12
mychl
Member
 
Registered: Jul 2001
Location: Earth
Posts: 164

Rep: Reputation: 30
You could just use smbuseradd to add a samba user and make the user/passwd the same as you use to log into your win2k machine.

That way it will mount it automatically everytime you logon to your w2k box....
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File sharing between Linux and Win XP keithdj Linux - Newbie 3 09-07-2005 07:00 AM
File sharing with Win XP Pro and MDK 9.1 how to? Kramer Linux - Networking 1 07-03-2004 06:45 PM
Win Xp and RH9 File Sharing steve_d555 Linux - Wireless Networking 13 04-14-2004 08:15 PM
Question: Linux + Win file sharing with Samba yurlittlepony Linux - Networking 2 08-29-2003 11:39 PM
win xp file sharing Judas Linux - Newbie 2 10-17-2002 09:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:00 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
Open Source Consulting | Domain Registration