APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Home > Forum > Map network drive, connect as different user to same Server
Printer Friendly Version




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.


If this page was useful to you, please click to help others find it:  
Your +1's can help friends, contacts, and others on the web find the best stuff when they search.


34 comments




More Articles by Tony Lawrence - Find me on Google+



Click here to add your comments





Wed Nov 1 12:04:03 2006:   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:   anonymous


Whats a computer?



Tue Mar 6 08:12:22 2007:   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:   anonymous


Great information! This was exactly what I was looking for. Thanks for figuring this out.



Sat Aug 11 21:11:17 2007:   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:   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:   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:   TonyLawrence

gravatar
"has ms blocked this workaround"

I believe Vista works differently and this won't do the trick.



Wed May 14 07:16:09 2008:   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:   anonymous

gravatar
Your fucking back button redirect is annoying, and I will never visit this site again.

Fucker!



Fri Apr 3 18:22:11 2009:   TonyLawrence

gravatar
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:   anonymous

gravatar
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:   TonyLawrence

gravatar
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:   TonyLawrence

gravatar
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 :-)



Mon Apr 13 14:26:49 2009:   TonyLawrence

gravatar
Here's something similar done a different way:

http://www.macosxhints.com/article.php?story=20090408122756546



Wed Apr 22 14:27:34 2009:   anonymous

gravatar
Worked for me too! I'm glad I found your site! Thanks.



Thu Jul 23 00:43:50 2009:   anonymous

gravatar
Thanks for posting this great tip. It solved that problem for me



Tue Feb 2 01:55:54 2010:   anonymous

gravatar
Thanks for the idea. Using the IP address is good enough for the "I don't want to reboot" times.
Otherwise, I would recommend you add a small paragraph on how to use the hosts file to add as many local DNS entries as necessary to trick Windows into believing there is so many network servers.



Wed Jun 16 08:19:39 2010:   Farvej

gravatar
Hi, could you please elobarate this line configure Samba with the same netbios aliases after dns alias for mapping same server with different user names (more than 2 connections)



Wed Jun 16 10:21:41 2010:   TonyLawrence

gravatar
Well, I'm not sure what you don't understand. First, obviously you need control of your locals dns . If you don't have that, there is nothing you can do. Then you edit the Samba config to add the same aliases. You map your drives to those aliases. It's that simple.



Thu Jul 8 03:43:24 2010:   ianbutton
http://www.chelsearotary.org.au
gravatar
This was very helpful. Thank you for the tip. Cheers from Down Under.



Mon Oct 4 01:41:23 2010:   anonymous

gravatar
Thanks...it solved my problem too........



Sat Jan 15 02:23:39 2011:   anonymous

gravatar
Still useful 6 years on :D works on Windows 7. Thanks!



Tue Jan 18 21:26:23 2011:   anonymous

gravatar
This doesn't really work for me and win7 for two reasons which may not be problems for you. First it's a laptop so mapping to a local IP doesn't work since every time they open My Computer it will seek out that mapping. So if they are on another network it will search out that IP, not good. The other problem was that I mapped the My Docs to the server and when connecting to another network then back it would lose the library (there are no folders associated with this library) So I just settled for one mapping.



Mon Jan 24 06:18:25 2011:   Jo

gravatar
Hi,
The link is invalid, can you please explain what's the workaround?



Mon Jan 24 13:42:30 2011:   TonyLawrence

gravatar
See http://support.microsoft.com/kb/812793 also.

That cramsession link is dead. Stupid webmasters...



Thu Aug 11 16:04:17 2011:   anonymous

gravatar
I'd +1 but Google wants me to login and track me. No thanks.



Thu Aug 11 18:37:32 2011:   TonyLawrence

gravatar
Thanks for the thought anyway :-)



Mon Sep 12 13:17:19 2011:   anonymous

gravatar
very useful, is't just i looking for ... Great!!



Wed Sep 14 07:51:19 2011:   Tinminator

gravatar
things maybe simpler if you try "Net use"
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/net_use.mspx?mfr=true



Sat Oct 15 17:18:02 2011:   TylerMorrison

gravatar
Ok, so an easy fix is changing your network adapter settings to have multiple IP addresses and using a different ip per share. This is technically the easiest and best way to fix your issues.

It's similar to how you do it in XP except you need to go to change adapter settings in Network and sharing center. You then go to the properties of your adapter, double click on IPv4 and then click advanced. Use this to add as many ips as required!



Sat Oct 15 19:42:33 2011:   TonyLawrence

gravatar
That won't work if you don't have admin access to the machine you need to map.



Wed Nov 2 13:08:20 2011:   anonymous

gravatar
yes! worked on windows 7.
Just tried using the ip address cause I needed only two logins.
Thanks for the great idea!

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



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.


My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!


book graphic unix and linux troubleshooting guide




Buy Kerio from a dealer who knows tech: I sell and support

Kerio Connect Mail server, Control, Workspace and Operator licenses and subscription renewals
pavatar.jpg

This post tagged:

       - Forum
       - Microsoft
       - Networking
       - Popular
       - Samba




Unix/Linux Consultants

Skills Tests

Guest Post Here













card_image