Apple - Is it possible to view passwords through Terminal?

Check out the security command. You can get detailed information about its use by reading its man entry man security

An in-depth article on the securitycommand is here.


Suppose we are talking about an internet password of a site. Then you would input:

security find-internet-password -gs www.paypal.com

On the other hand if we are talking about a generic password, we use the command

security find-generic-password -gs www.test_site.com

where,

-g: is used to display the password for the item found

-a account_name: matches the account name given

-s server: matches teh server string

sources:

http://blog.macromates.com/2006/keychain-access-from-shell/ https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/security.1.html