OS X Server alias remembers last-used name. Stop it!
August 26, 2006 5:55 AM   Subscribe

OS X: An alias to a server remembers the last user name that was used. Where is that piece of data stored, and can I change it to be blank? (On a public lab computer, I'd rather the dialog comes up empty rather than suggesting the last-used name.)
posted by Wolfdog to Computers & Internet (8 answers total)
 
Is it in the keychain? I've never heard of an alias remembering login information, but the Mac will remember it in the Keychain.

Look for a program called "Keychain Access". Mine is stored in Applications > Utilities, but I don't know if I moved it or not.
posted by willnot at 7:15 AM on August 26, 2006


Response by poster: No, it's not in keychain. It doesn't store all the login info (though you can save that in the keychain when you connect to the server.) Just the last-used name pops up in the connection dialog.

The alias itself is just a link to the mountpoint (/Volumes/ThatDamnServer). So somewhere else is stored what was supposed to be mounted there and who used it last.
posted by Wolfdog at 7:41 AM on August 26, 2006


Don't confuse terms like "alias" and "link" or you'll get confused answers. Aliases (alii?) are Mac OS data structures that describe files using IDs, usernames, and other private stuff to help identify them even if they've moved. "Links" are BSD constructs that work solely by pathname. Aliases are just data types, like strings or integers; alias files are the Finder construct that you work with in the UI.

That said:

A "minimal" alias (data structure) doesn't contain login information, but you can't make the Finder create a minimal alias file if it doesn't already. The alias data structure is opaque and private, so you can't go in and edit it by hand, at least not reliably.

A Unix-style link probably won't help - it's just a pathname to your server, like "/Volumes/MyServer/myfile", so if MyServer isn't mounted, it just returns an error. You need an alias to try to actually mount missing volumes, but then the OS helps out by filling in the user name used to make the alias.

One procedure you might try:

Temporarily enable guest access to the server and directory in question. Log in as a guest and make the alias. Lock the alias file so it can't be "updated," then turn off guest access. This should give you an alias file with no username stored in it, and since it's locked, neither Finder nor any other program can helpfully "update" it with someone's login credentials.

Hope this helps™.
posted by mdeatherage at 7:55 AM on August 26, 2006


Response by poster: That procedure would be good, but I won't be able to enable guest access to the server and probably can't expect any cooperation from anyone who would be able to, so ideally I'd like a purely local solution. Thanks for the clearing up the terminology, though; that's helpful.
posted by Wolfdog at 8:25 AM on August 26, 2006


If you don't care if it's a true OS X alias and instead looks like a bookmark, you can create a URL to by typing the text path to the fileserver in question and drag-n-drop it to the desktop.

For instance, say on my home network I have a server called "foobar" which has a share called "backups" and a directory within backups called "games". I can type the text:
afp://foobar/backups/games
drag the above text to the desktop, and it creates a file that when double-clicked will connect and mount. If the share is a Windows (Samba) box, change "afp" to "smb".
posted by todbot at 8:37 AM on August 26, 2006


Oh and if you want the username and password to be in the url, do something like: smb://user:pass@foobar/backups/games.
posted by todbot at 8:39 AM on August 26, 2006


Write an AppleScript which requests the username and password through a user dialog.

with timeout of 5 seconds
try
launch application "Finder"
open location "afp://1.2.3.4"
on error
display dialog "Could not connect to server!"
end try
end timeout


Replace 1.2.3.4 with the IP address of your server. You'll be prompted for a username and password.

You could add error-checking code to disconnect the server if it it already mounted, etc.
posted by Blazecock Pileon at 10:16 AM on August 26, 2006


I don't think the alias itself is involved. The username is being presented in the login dialog that is presented during the login attempt to the server, correct?

So the code that is fetching the username is the code on the local machine responsible for presenting the login dialog. I'd look for an option to not remember this data somewhere in the OSX networking dialogs.
posted by Dunwitty at 4:52 PM on August 26, 2006


« Older U.S. Customs and Chinese knockoffs   |   Organ donation (the musical kind) Newer »
This thread is closed to new comments.