AMITIAE - Saturday 13 October 2012
Command Line Work: New Users and Terminal (14) -- Passwords, Purging and Closing Notes |
|
By Graham K. Rogers
PasswdThere are occasions when a user may need to change the password in an account on a Mac running OS X. This is usually effected by entering System Preferences > Users & Groups, and clicking on the Change Password button in the specific user's panel.There may be times when this is not possible: the panel is locked in a user account and the Admin account is not accessible; the user has forgotten the password; the Admin user has forgotten the password. There may be other situations where the password cannot be changed using System Preferences. The command used is passwd. As ever, care is needed for what is a fairly simple command and one that sysadmins of Linux- or Unix-based networks apply when their users forget passwords. The command may be used in a number of ways:
The man passwd entry indicates that new password should be at least six characters long and not purely alphabetic. Its total length should be less than 128 characters (currently). Users are urged to use numbers, upper case letters, and other characters (e.g. & $ > *) for security reasons. When the password has been verified, the information is entered into the directory system. However, users of OS X may need to use the old password one time with Keychain Access to confirm the changes and allow continued access to passwords in that utility.
passwd username Even as Admin in OS X 10.8 (I am using 10.8.2), the command prompts for the old password before allowing the process to continue.
Basic information on this is in an item by David Mendez on OS X Daily; and dire warnings about the risks in an article on Secure Mac. I would also add that, as this can be dangerous in the wrong hands, users run the Firmware Password Utility (in the Rescue utilities, accessed by using the keystrokes Command + R at startup). Forgetting that password will cause other problems, however.
PurgeThere are occasions when the system on any computer begins to slow and one of the suggested tasks that might speed things up (there are many) is to empty the disk cache. Remember there is also a cache for a browser: this disk cache is not the same. However, there is a command that will allow a user to flush and empty the cache: purge.That is it: simple and straight forward. It takes about 15 seconds to run on my Mac. However, while cleaning out the problem parts of a cache, the useful parts will also go and the system will have to rebuild cache following this operation. Additional information in the brief manual entry tells us the command "can be used to approximate initial boot conditions with a cold disk buffer cache for performance analysis. It does not affect anonymous memory that has been allocated through . . ." certain system processes.
Closing NotesThe series of commands I have been writing about (see list below) were not intended as a definitive guide to using Unix commands on a Mac, but more as a way for new users who might be unfamiliar with a command line interface to try one or two commands (in relative safety) and gain interest.I had intended to include the debug command, but others have beaten me to it this week and there is no point reinventing the wheel. Early in the week, Paul Horowitz on OS X Daily wrote an article, "10 of the Best Defaults Write Commands to Improve Mac OS X" which illustrate how certain applications settings may be changed writing to the files that control the applications. There are many more and some may be found on Internet sources. Later in the week, Topher Kessler on MacFixit (now part of CNET) completed the circle in an article which outlines some of the ways defaults may be used to read, write, and delete Mac OS X user defaults from the command line. These two articles, plus man defaults will give those interested enough to be going on with.
Graham K. Rogers teaches at the Faculty of Engineering, Mahidol University in Thailand. He wrote in the Bangkok Post, Database supplement on IT subjects. For the last seven years of Database he wrote a column on Apple and Macs. |
|
For further information, e-mail to