Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a machine running Ubuntu with Samba that I use to share stuff with my family's Windows machines in our local network. Currently they access a share for movies/music/etc with one user.

I want to connect them to another share as a different user (for example, user "goytacaz").

When I try connecting to this new share, Windows gives me "Error 1219" and complains about multiple connections by the same user.

How do I get my machine to accept multiple connections by the same user?

share|improve this question

migrated from stackoverflow.com Jan 14 '10 at 17:16

This question came from our site for professional and enthusiast programmers.

    
Are you just looking to connect using samba? Samba already supports this AFAIK. –  heavyd Jan 14 '10 at 17:32

5 Answers 5

Over Samba? There shouldn't be any problems; as long as the username & password are correct both connections should happen correctly.

Update: re: "Error 1219". This is a client-side error -- Windows only allows you to connect to a server as one user at a time. (See Microsoft documentation at KB938120.) This means the Windows machine has already connected as a different user, and so your attempts to connect again, as the correct user, are failing.

You need to disconnect the first connection before you can reconnect. Two ways I know of to do that:

  • Disconnect any reconnect-at-logon network drives from that server. Reboot. Reconnect to the server and make sure you give the proper username and password.

  • Use the net use /delete command from Windows' command shell (Start -> Run -> cmd; at the prompt type the command; you may need to specify a share name).

Update 2: If the users are already connecting to the server with one user, you won't be able to let them connect with a second user. You'll have to reconsider your share strategy, and reconfigure Samba to follow that strategy. (This isn't your fault; I blame Windows.)

Personally, I'd stick with individual users for each person, and consider using groups to control access to the shares. This works well if you have some shares that you want everyone to have read-write access to, and others that you want to be read-only for all but a select few users.

Update 3: The MS document linked above offers these two workarounds to enable connecting to the server as separate users. The general idea is, make Windows think it's connecting to a different server by using a different name.

  1. Use the IP address of the server when you connect with the second username. (Use \\ServerName\sharename when connecting as the first user, but use \\X.X.X.X\sharename when connecting as the second user.)

  2. Create one or more DNS alias(es) for the server to use when you connect with the second (, third, fourth...) username. (Use \\ServerName\sharename when connecting as the first user, but use \\ServerAlias1\sharename when connecting as the second user, \\ServerAlias2\sharename when connecting as the third user, etc.)

share|improve this answer
    
Thank you for this answer. I had the same issue, and connecting using the server's IP address instead of DNS name worked for me for the second connection. –  Ben Torell May 25 '10 at 15:43

If you prefer to not fiddle with each client to solve a server issue, you can use the smb.conf file to setup name aliases for the server. This has the added benefit of each alias showing up as distinct server in the Windows Network.

Edit your smb.conf file and add the following entry in the [global] section:

[global]
...
netbios aliases = alias1 alias2 readonly


After a restart of samba (remember to restart smbd AND nmbd!) you should be able to access the new server aliases using UNC notation in the Windows Explorer.
Note that it might take a little time, at my site about 1 Minute after the samba-restart, for them to work.
Once the aliases show up in the Windows Network you're definitely good to go.

share|improve this answer

This is a solution for Windows 7 (although it might work for other versions as well)

  1. open Notepad (or any text editor) as Administrator
    (you have to right click and say 'run as Administrator')

  2. find : c:\WINDOWS\system32\drivers\etc\hosts (you will need to show all files not only .txt)

Now, if i.e. :
- you have 3 samba users: tom fred jon
- 3 samba shares on your samba server (i.e. IP: 192.168.0.100): docs stuff pics
- you want to connect as tom to docs, as fred to stuff and as jon to pics

Now add the following lines to the hosts file:

192.168.0.100   tomsdocs   tomsdocs
192.168.0.100   fredstuff  fredstuff
192.168.0.100   jonspics   jonspics

Once you close and save you can "Map a network drive" like so:

\\tomsdocs\docs as user tom
\\fredstuff\stuff as user fred
\\jonspics\pics as user jon

Note that the names above are totally up to you ... Whatever you put into the hosts file will need to mach what you call the server when you map the network drive.

The reason this works, is because windows needs to think it is connecting to different servers. Arguably, you could also set up your own home DNS server, but I prefer faking a bunch of entries in the hosts file (which gets evaluated before your windows machine asks the DNS for help).
Since the entire problem is a client side windows problem, I prefer doing it this way.

Hope this helps.

share|improve this answer
    
This worked like a charm! Fiddled for an hour with the samba share on the server until I found this - Thanks :) –  lorem monkey Sep 2 '13 at 23:19

i was just having the same issue.

for one user i use: \192.168.x.x <-- IP of the ubuntu server for the other user: \server-name <-- hostname of the ubuntu server.

this allowed me to connect with a windows machine using different logins.

share|improve this answer

use the IP address (or host name if you use the IP address) of the server

http://support.microsoft.com/kb/938120

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.