I need to disable Google chrome's print preview option using the script
"defaults write com.google.Chrome DisablePrintPreview -boolean true -contributed by CutMaster", to a mac using ssh and apply this to all users.
The script above only works when you enter it when logged in as a user. However, I do not have access to the user's account but I do have access to the admin account.
Your help is much appreciated.
Best Answer
Use the
sudo
commandThe command is
sudo -u username command
So, after you SSH in as the admin, issue the command:
That will set the preferences value for the particular user you are interested in without having to know their password.
I personally checked this on OS X 10.11.4 using an account called "testguy". I was able to SSH into the machine, set the preferences using the command you provided and verify that it was set by issuing the command:
The response was
1
(true)