From owner-freebsd-questions@FreeBSD.ORG Wed Nov 12 13:38:11 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6CBD916A4CE for ; Wed, 12 Nov 2003 13:38:11 -0800 (PST) Received: from nic.fnni.com (nic.fnni.com [204.58.233.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 52BFE43F3F for ; Wed, 12 Nov 2003 13:38:09 -0800 (PST) (envelope-from bchirhart@fnni.com) X-Server-Uuid: b40b4260-68f5-11d4-98ee-00508bdcae1a Message-ID: <200311122138.hACEapjs011714@nic.fnni.com> From: "Chirhart, Brian" To: "'peepstein@canada.com'" Date: Wed, 12 Nov 2003 15:37:58 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) X-WSS-ID: 13AC7784239987-01-01 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.1 cc: "'freebsd-questions@freebsd.org'" Subject: RE: Mount SMB share on bootup X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2003 21:38:11 -0000 Ed - that worked great... Thanks!! I am not sure what I did, but it worked. What language is that script in? It isn't perl - is it C? -----Original Message----- From: Edward Epstein [mailto:peepstein@canada.com] Sent: Monday, November 10, 2003 5:43 PM To: Chirhart, Brian; freebsd-questions@freebsd.org Subject: Re: Mount SMB share on bootup Lines prefixed with ">" are what Chirhart, Brian wrote. >>> point is password protected (on the XP side) so I am prompted for a >>> password. How can I automate that? Or should I create the share without > >a > >>> password? I am not too worried about internal security so the share > >could > >>> have no password and that would be fine. >> >>Create a script called whatever.sh, chmod +x 755 whatever.sh and put that >>script in a /usr/local/etc/rc.d. >> >>Put the following lines in that script >> >>#!/bin/sh >>smbmount username=user password=pass and the rest of the parametars that > >you > >>are normaly using when mounting smb partition. >> >>Mind that if your startup script for samba is samba.sh your mounting script >>must start with a letter after the letter s otherwise you would mounting a >>samba share without smb daemon started. > >################################ > >When I try the smbmount I get a "command not Found" > >I checked the man pages on mount and found mount_smbfs, but I can not find >any options that would allow me to specify a username and password. > >I am not using Samba (at least I didn't load it... may be there by >default???) - To map the drive I have a line in my /etc/fstab file that >reads: > ># Device #Mountpoint FSType OPtion >//user@server/share /ftproot smbfs rw.nosuto 0 0 > >Once the server boots, I type "mount /ftproot" and then it asks me for the >password for User. After the password is entered, /ftproot contains the >contents of the share on my XP system. It was one of the things that I fell >in love with about BSD - the ability to "see" XP shares with no special >"magic". > >So anyway - I think there are several different approaches to this. Can I >modify my fstab file so that "auto" would work by somehow specifing a >password? Or is there a password option that I am missing in the mount or >mount_smbfs commands? OR... is there a reason I don't have the smbmount >command? You are on the right track; it took me a while to figure this one out too. You've got your /etc/fstab file set up correctly. This is how the line for me looks, it's just like yours. //EDWARD@CHAOS/SHARE /mnt/chaos smbfs rw,noauto 0 0 To specify your username and password for the mount, you should create /etc/nsmb.conf the syntax for this file is shown in /usr/share/examples/smbfs/dot.nsmbrc Here is an example from my machine: #nsmb.conf [CHAOS] addr=10.0.3.3 [CHAOS:EDWARD] password=XXXXXXXXX Finally, to mount on bootup, create a file in /usr/local/etc/rc.d with the following contents (or something similar; you probably didn't name your share CHAOS): -edward@interface$ more /usr/local/etc/rc.d/010.chaos.sh #! /bin/sh case "$1" in start) echo " Mounting CHAOS..." mount /mnt/CHAOS &>2 ;; stop) echo " Unmounting CHAOS..." umount /mnt/CHAOS &>2 ;; esac Also, I make sure my /etc/nsmb.conf file is owned by root and chmod'ed 600 because it contains a password in plaintext. Don't forget to make sure that your file in /usr/local/etc/rc.d is chmodded at least 700 so that it's executable by, at the very least, the owner (should be root). I hope this is clear enough to make some sense to you. Regards, Ed >Thank you for all your help! >_______________________________________________ >freebsd-questions@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-questions >To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" -- "There are people who cheat on their spouse but not at cards, and vice versa, and both and neither. Reputation is not necessarily portable from one situation to another, and it's not easily expressed." --Clay Shirkey. (http://www.shirky.com/writings/group_enemy.html) "It has been said that man is a rational animal. All my life I have been searching for evidence which could support this." --Bertrand Russell. "The American empire is ideological, not territorial. We are the most ideological people in the world, and we are so united in our view that we don't understand there can be other views." --Lt. Gen. William Odom, ret. (Former Director of NSA).