If you’re working with sensitive materials or in a public environment, such as in the office, it is good practice to lock your screen whenever you are not at your desk. This is especially important if you have your keychains unlocked or have auto-fill forms enabled for your browser.
There are a few ways to lock your screen, you can log out or close the lid of your macbook. However that will close any programs which you have running or log out any remote users who are currently logged in to the machine.
I had a similar situation the other day when I was updating my iPhone’s iOs to a new version. iTunes was downloading the update which amounted to a few hundred megabytes, estimating to take about and hour. I had to leave the desk to go to a meeting and didn’t want to leave my macbook open and at the same time i didn’t want to log out of put the machine to sleep and cancel the download.
There are a few ways to lock your screen and still remain logged into the machine. The first would be using the screensaver, In system preferences under security, there is a general preference to require a password after the screen saver has been running for a set time. This however requires you to wait until the screensaver starts before your screen is locked, which isn’t ideal as you don’t always know x number of minutes before that you need to leave your computer. You can overcome this but setting that value to require a password immediately once the screen saver has started and then to assign one of the corner in expose to start the screensaver.
The other way of locking your screensaver is my preferred method as it gives me more control and I won’t accidentally start the screen saver using expose.
Go to Applications > Utilities and select KeyChain Access
Then go to the preference window for the Key Chain Access by pressing on the Command and , keys
In General preferences, check “Show Status in Menu Bar”
Now you should have a lock icon in your menu bar
When you click on the icon, you can choose to lock your screen or your keychain.