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!

  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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: