Mount a samba drive, with password from keychain
Here's how I did it

mkdir -p /Volumes/work \
&amp;&amp; mount -t smbfs //admin:$(security find-internet-password -D "Network Password" -l "share name" -w)@server/work /Volumes/work


The keychain access was a bit tricky, I found the answer and wrote it there. The important part was the capitals when specifying the secret kind.

You'll need to be able to create directories in /Volumes as well. This answer helped me.