I couldnt use autofs to automount a windows xp share, then I found that I had to change the auto.smb to use my user and password according to this script below: as Ashar Voultoiz suggest in http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg138136.html : Hello there ! I have discovered autofs recently and it looks amazing to manage samba share. So I have uncommented auto.smb in the auto.master file and tried lsing /smb/myserver/ . Failure! My file server is a Microsoft Windows 2000 system that require a username and password to connect to. I have patched the auto.smb file (see below) so it look for an optional credential file that looks like /etc/auto.smb.<hostname> . I have a few hosts so its easy for me. If the file doesnt exist, it just use the old system. Here is the full file (sorry I got no proper patch cause I forgot to backup the original file). --------------------8<------------------------------------------------------- #!/bin/bash # $Id: auto.smb,v 1.3 2005/04/05 13:02:09 raven Exp $ # This file must be executable to work! chmod 755! key="$1" credfile="/etc/auto.smb.$key" mountopts="-fstype=smbfs" smbclientopts="" for P in /bin /sbin /usr/bin /usr/sbin do if [ -x $P/smbclient ] then SMBCLIENT=$P/smbclient break fi done [ -x $SMBCLIENT ] || exit 1 if [ -e $credfile ] then mountopts=$mountopts",credentials=$credfile" smbclientopts="-A "$credfile else smbclientopts="-N" fi $SMBCLIENT $smbclientopts -gL $key 2>/dev/null| awk -v key="$key" -v opts="$mountopts" -F'|' -- ' BEGIN { ORS=""; first=1 } /Disk/ { if (first) { print opts; first=0 }; print " \\\n\t /" $2, "://" key "/" $2 } END { if (!first) print "\n"; else exit 1 } ' --------------------8<------------------------------------------------------- Then i created /etc/auto.smb.<hostname> which contain: username = Someuser password = Somepassword Then a ll /smb/<hostname> gave me the files :p So I ask to change auto.smb
Could you please tell which version of autofs you are using with this script? Please include emerge --info as well for completeness. I have already problems to use it to connect to shares without password protection, so I'd like to have a starting point to get this working. Then I can think about adding a reworked script to autofs. Thanks.
(In reply to comment #1) > Could you please tell which version of autofs you are using with this script? > Please include emerge --info as well for completeness. > > I have already problems to use it to connect to shares without password > protection, so I'd like to have a starting point to get this working. > Then I can think about adding a reworked script to autofs. > Thanks. Please post needed info if still valid