Set object2 origin point to its right bottom corner and you are free to scale in object mode.

Select object2, go to edit mode, select right bottom vertex, Shift+S > Cursor to selected.
Return to object mode Shift+Ctrl+Alt+C > Origin to 3D cursor.  

how to lock object face a certain distance away from another object face?
I am using oh-my-zsh configuration which has some handy bindkey condiguration. For example: "^[B" backward-word. On Linux I can use it with ease, but on OSX when I press alt-B i get some chars instead moving cursor. Can I configure somehow shortcuts alt+key on OSX or is there any trick to use them of of the box?
