How to add user to a group from terminal on Mountain Lion

mac-osxterminaluser-accounts

When I run

sudo dscl . -append /Groups/com.apple.access_ssh GroupMembership $USERNAME

I get

append: Invalid Path
<dscl_cmd> DS Error: -14009 (eDSUnknownNodeName)

Best Answer

I just looked at my copy of Mountain Lion and the com.apple.access_ssh group doesn't exist until you've actually turned on "Remote Login" in System Preferences.

When you turn on Remote Desktop AND set it to "Allow access for: Only these users", then there is a group called "com.apple.access_ssh". When you set it back to ""Allow access for: All users", the name of the group is changed to "com.apple.access_ssh-disabled".