Map network drive, connect as different user to same Server
Author: TonyLawrence
Date: Tue Feb 22 23:04:52 2005
Subject: Map network drive, connect as different user to same Server
I ran into an interesting problem today. I was helping someone configure Samba and had shown him the XP/2000 trick of mapping a network drive and having it connect as a different user. He then wanted to map another network drive to another share on the same server, but this time connect as an entirely different user.
Windows won't do that. You can't use different credentials to connect to different shares on the same server. Once you provide a username and password for an smb server, Windows XP/2K wants to use that for ALL shares on that server.
That's actually a useful feature. For example, I use that to connect printers that otherwise would need authentication. By mapping a share that reconnects at logon, the printers are automatically available because attempting to connect to them will automatically use the same logon/password as the mapped drive did.
But darn it, this person really needed to connect multiple times with different user ids. After some digging, we figured out how to do it: fool Windows into thinking it isn't the same server. One way to do that is to use the ip address for one connection and the smb name for the other, but that only gives you two connections. To get more, you need to add aliases into DNS and configure Samba with the same netbios aliases. With that trick, Windows happily makes multiple connections with different user name/password logons. Basically, it doesn't realize that it is connecting to the same machine.
See
http://www.cramsession.com/articles/get-article.asp?aid=294 for an explanation of how Windows decides what credentials to use.
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site:
Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Publishing your articles here
Jump to Comments
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.
Click here to add your comments
Wed Nov 1 12:04:03 2006: Subject: anonymous
Thanks for the clue: it does work. But then you have to reenter the password when you want to access the drive for each new session (or I made something wrong in the initial mapping).
Tue Nov 21 04:25:33 2006: Subject: anonymous
Whats a computer?
Tue Mar 6 08:12:22 2007: Subject: anonymous
Yes, when you log off the computer. You open the network drive you have to reenter the password. Do you have another way to not reenter the password ?
Fri May 18 19:40:36 2007: Subject: anonymous
Great information! This was exactly what I was looking for. Thanks for figuring this out.
Sat Aug 11 21:11:17 2007: Subject: anonymous
Great hint, the workaround works well.
If only all posts in forums were so competent.
Can't understand why Windows behaves so silly.
Thanks.
Mon Aug 13 14:58:38 2007: Subject: BigDumbDinosaur
Can't understand why Windows behaves so silly.
Don't feel too bad. Microsoft doesn't understand it either. <Grin>
Tue May 13 14:49:06 2008: Subject: anonymous
has ms blocked this workaround I can not get it to map even when using the ip for one and the servername for the other
Tue May 13 15:24:48 2008: Subject: TonyLawrence
"has ms blocked this workaround"
I believe Vista works differently and this won't do the trick.
Wed May 14 07:16:09 2008: Subject: anonymous
the wrokaround is not working on xpsp3 get the error when refering to the saem server by ip and servername
Fri Apr 3 18:09:20 2009: Subject: Back Button Bullshit anonymous
Your fucking back button redirect is annoying, and I will never visit this site again.
Fucker!
Fri Apr 3 18:22:11 2009: Subject: TonyLawrence
Can anyone guess what this person is complaining about?
Does he/she mean the "Older" link? What's annoying - or if you do find it "annoying", why use it?
I have no idea what the problem is..
Fri Apr 3 19:37:45 2009: Subject: anonymous
This is a guess, but Mr/Ms Congeniality might be referring to the issue I am seeing with your site in IEv6. I have to click the back button in the browser twice for it to actually go back a page. This doesn't happen on Firefox at home (not sure which version, the latest I assume).
Fri Apr 3 20:10:31 2009: Subject: TonyLawrence
That's almost too funny - he or she is using an ancient browser and blames me for its failings?
Oh well: I've said before that I no longer care about IE6 and its problems (which go way beyond any silly back button issues, by the way).
Still, it is interesting - I wonder what it is that causes that? Here's a thread that blames malware: http://www.pcguide.com/vb/showthread.php?t=37147
But this says it's slow loading ads: http://forums.vwvortex.com/zerothread?cmd=print&id=3913141 - that seems more likely.
Sat Apr 4 13:23:51 2009: Subject: TonyLawrence
I was thinking about this more and realized that the anger must come because they think I'm doing this deliberately to "trap" them on this site. I suppose even if they had thought to try a different browser (which they ought to be using anyway!) they might still think that..
Too bad.. I wish I could apologize to perhaps calm them down. They must see the same issue at other sites but if anyone know WHY this happens I'd be willing to fix it if it doesn't require tremendous effort. I'm willing to do a *little* work for IE6 users, just not very much :-)
Take Control of Fonts in Leopard
Mon Apr 13 14:26:49 2009: Subject: TonyLawrence
Here's something similar done a different way:
http://www.macosxhints.com/article.php?story=20090408122756546
Wed Apr 22 14:27:34 2009: Subject: anonymous
Worked for me too! I'm glad I found your site! Thanks.
Thu Jul 23 00:43:50 2009: Subject: Great Trick anonymous
Thanks for posting this great tip. It solved that problem for me
Don't miss responses! Subscribe to Comments by RSS or by Email
Click here to add your comments
If you want a picture to show with your comment, go get a Gravatar