Home > Mac administration, Mac OS X > Logging into a SMB file server multiple times with different usernames from one Mac

Logging into a SMB file server multiple times with different usernames from one Mac

An issue that I’ve run into at my workplace has been people requesting the ability to log into our SMB-using file servers with different usernames. In my specific case, I have a user who wanted to be logged into one of our Windows file servers as username, but also wanted to connect to a specific share on the same server using a different account called other_username.

Normally, this wouldn’t be an issue except this user wanted to log into share A on the server with username and share B on the server with other_username and have both shares mounted at the same time. This is a problem because the Mac’s normal behavior is to keep using the same username / password authentication when connecting to different shares that are hosted on the same server.

To make this issue that much harder to address, our Macs and our file servers are also both bound to the same Active Directory domain, which means that our users normally aren’t being prompted for their usernames and passwords. Instead, they’re using Kerberos to handle logins for the file servers. Kerberos is using the AD account of the logged-in user as part of its authentication process to our servers, so any file share will mount using that account’s access rights.

Fortunately, it does appear that there is a way to make this work. Even better, it doesn’t require breaking Kerberos or trying to get around it. See below the jump for details.

To connect to an SMB file server using a different username, you can use this procedure:

1. In the Finder, choose the Go menu, then select Connect to Server.


2. Type the network address for the computer or server in the Server Address field in the following format:


Screen Shot 2013-05-31 at 1.33.17 PM

The ” * ” is to trigger the server login window for your SMB server, so that the password for the other_username account can be entered.

3. Click the Connect button.

4. Enter the desired username and password when prompted.

Username: other_username

Password: The current account password for other_username

Screen Shot 2013-05-31 at 1.33.02 PM

5. Select the share on your SMB server that you want to use.

WARNING: Do not try to mount the same share twice using different usernames.

One way you can verify that you’re actually connected using different usernames is to use the mount command in Terminal. This should show all mounted volumes on the Mac, including mounted fileshares. The fileshare mount information should include which account was used to mount the share.

Screen Shot 2013-05-31 at 1.55.39 PM


Depending on your file server, this approach may not work consistently. On our Isilon storage, the SMB share would mount with the user-specified username every time. On another server I tested, the server would prefer the specific username that was last used to connect and keep using that username when mounting additional shares.

Hat tip: kbotnen in the ##osx-server IRC room

  1. John
    May 31, 2013 at 7:42 pm

    Prior to 10.7, we’d do the same thing with smb://username@server.fqdn.tld


  2. May 31, 2013 at 7:50 pm

    Nice, a bit cleaner documented than our internal documentation 🙂

  3. Arjen van Bochoven
    June 1, 2013 at 1:17 pm

    I use mount_smbfs from the terminal, which is not kerberized. But that is not something I would promote for my regular users in our AD environment.

  4. October 2, 2014 at 9:23 pm

    Very useful.
    Thank you

  5. January 23, 2015 at 2:47 pm

    I was wondering what I should do if I want to connect to smb://zanes22:*@ww1file-01.wildwood.org . I tried to, but it told me I couldn’t connect. (Y’know, it’s my school’s server)

  6. July 15, 2015 at 9:35 pm

    I tried this but it still connects using the username that I’m logged onto my MacBook Pro with. Unfortunately that isn’t going to work as I need to use a different username for this SMB share. I’d appreciate any thought people might have on this.

  7. March 9, 2016 at 4:42 am

    The best info. Clear and precise.

  8. Robyn
    August 4, 2016 at 10:00 pm

    SO helpful. Thank you very much for posting this!

  9. Bill Buhler
    November 18, 2016 at 9:46 pm

    Extremely helpful! @aknjeer are you trying to access the same share with two different accounts? From my testing that doesn’t work, but two separate shares does work.

  10. July 18, 2017 at 3:27 pm

    …This is great. Anyway to pre-define a domain designation? IE: domain\username?

  11. July 23, 2017 at 6:55 pm

    This is super helpful and solved my problem! Any idea how to configure it to survive a reboot? I just confirmed that it does not. 😦

  12. VickiH
    May 1, 2018 at 2:17 pm

    OMG this has been an excellent HELP THANK YOU SO MUCH!

  13. Tantum
    February 14, 2019 at 5:03 pm

    Thanks, this was very helpful

  14. DF
    February 22, 2019 at 2:39 am


  15. April 10, 2019 at 1:15 pm

    I know you said not to…. Tried mounting the same filesystem using different macOS users. i.e. Fred mounted smb://fred:*@host/share while Derf mounted smb://derf:*@host/share. It appears to work… But actually when derf copied a file it did so using the identity of the fred, even though each has their own /Volumes path (/Volumes/share and /Volumes/share-1). Using High Sierra 10.13.6

  16. Sarah
    October 29, 2019 at 9:11 pm

    This was driving me crazy! Much appreciated.

  17. aaa
    February 16, 2020 at 12:16 pm

    great great tip !!! thanks

  18. xzf
    February 22, 2020 at 1:23 am

    Works in MacOS Mojave 10.14.6 to samba 4.7.6-Ubuntu: mounted two different shares on the same server, each owned by its own samba user, with different passwords; correctly assigned ownership (serverside) of newly created files in each share to the respective samba user.

  19. Android Tester
    June 11, 2021 at 12:45 pm

    Gold! Thank you!

  20. January 7, 2022 at 9:06 am

    Gold as usual. You’d think I would learn to just start here… Thanks Rich.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: