Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 02-28-2004, 11:01 PM   #1
LQ Newbie
Registered: Feb 2004
Posts: 2

Rep: Reputation: 0
using fstab to mount windows xp shares

I've found a lot of great info about this topic here, but haven't found an answer to my problem. Here it is...

I am trying to mount a Windows XP share through /etc/fstab. I've added the following line into my fstab:

//KC01/Documents /Winshare smbfs auto,gid=users 0 0

When I start the computer, the boot log shows the following:

Mount SMB File System from /etc/fstab done
Password: SMB connection failed

In attempting to investigate the problem on my own, I opened a console and successfully used the following command to mount the Windows XP share:

mount -t smbfs //KC01/Documents /Winshare

However, after entering this, I am prompted for a password. Seeing as the Windows XP share is not set up to need a password (I am using Simple File Sharing, and have checked the option "Allow network users to change my files"), I merely press Enter, and the share successfully mounts. The problem is the password prompt. It's causing the line in fstab to fail. I've tried adding a 'password=' to fstab, but that just causes a failure as well.

Any suggestions on how I can either get rid of the password prompt, or possibly send a null password?
Old 02-29-2004, 05:27 AM   #2
Senior Member
Registered: Sep 2003
Location: The Netherlands
Distribution: Gentoo (main); SuSE 9.3 (fallback)
Posts: 1,607

Rep: Reputation: 46
I'm sure there's some elegant solution to this problem using fstab itself, but I didn't have the patience to look for it when I had a similar problem, so here's the "inelegant-but-it-works" solution:

Remove the lines from etc/fstab (cut and paste them to a "spare text" text file if you want to fiddle with this again in the future), and install LinNeighborhood (or use it if you have it already installed).

Go to the Edit=>Preferences menu and set your options, such as always scan as user, ask for user/pasword once, etc. in the Scan tab, default username and password in the Miscellaneous tab (even though LinNeighborhood does not seem to actually use the saved password info from this dialog when needed). Also in the Miscellaneous tab, set your default mount point and check "Memorize mounted shares and remount on startup". Do not check "Don't show mount dialog, just use defaults" at this time (you may be able to do so later, but I never use it so I don't know, although now that I think about it this may be why LinNeighborhood has never seemed to use the default user info).

Save and go back to the main window. Scan the network (you should get a u/p dialog once) and select the share you want to mount. Right-click and choose "mount" (easy enough, since it's the only entry in the right-click menu). A dialog will pop up with a guess as to your desired mount point (adjust if desired), the UID and GID of the mount point (adjust if desired and you have the permissions to do so) and the username and password for authentication on the SMB machine that you are mounting from. Put in the username and the null password and see if it mounts. If so, set up your other mounts as well.

Now, the only "gotcha" here is that the LinNeighborhood setting for "Memorize mounted shares and remount on startup" refers to LinNeighborhood startup, not system startup. So you have to add "LinNeighborhood -m" to your session so that LinNeigborhood starts without GUI when you log in, mounts the memorized shares, and then exits. Under Gnome this can be done by going to the GNOME Control Center=>Advanced=>Sessions and adding "LinNeighborhood -m" to the Startup Programs. Under KDE I believe this is done by adding a launcher pointing to "LinNeighborhood -m" in the .kde/Autostart folder in your $HOME$ (turn on "View Hidden Files" in Konqueror if you don't see the .kde folder). Or you could write a bash script, if you use another WM, or don't use X at all.

Hope this helps.
Old 02-29-2004, 07:47 AM   #3
Registered: Jul 2003
Location: London
Posts: 548

Rep: Reputation: 30
The "elegant" solution to this is to put:
in the options section of your fstab entry. This is equivalent to:
mount -t smbfs //KC01/Documents /Winshare -o password=
Old 02-29-2004, 07:56 AM   #4
Senior Member
Registered: Sep 2003
Location: The Netherlands
Distribution: Gentoo (main); SuSE 9.3 (fallback)
Posts: 1,607

Rep: Reputation: 46
Excellent! (I've always wanted to be elegant ) Hope it helps yeateke too, but I'm looking forward to trying it myself.

Thanks, ho_10!
Old 03-01-2004, 08:19 AM   #5
LQ Newbie
Registered: Feb 2004
Posts: 2

Original Poster
Rep: Reputation: 0

I tried out the 'elegant' method with mixed results. Sometimes it works, and sometimes it doesn't. I think though that this is more of a problem on the MS side with their file sharing. When it doesn't work, all I have to do is su to root and type "mount -a" to get it functioning.

Thanks for the tips!


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
Mounting Windows shares in fstab raypen Slackware 4 10-16-2004 05:16 PM
Linux can mount samba shares but not windows shares bindsocket Linux - Software 1 12-01-2003 05:28 PM
can anyone with rh9 mount multiple shares with smbfs in fstab? Falafel Linux - Networking 2 11-15-2003 08:15 AM
how do i mount windows shares on linux bongo.hickup Linux - Software 6 06-13-2003 03:44 AM
mount windows shares? Dave Campbell Linux - Networking 7 09-01-2002 04:54 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:41 PM.

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