I want to change a Mac (Hign Sierra) desktop background of one specific user account remotely. I am able to SSH into that machine by login in as a different user, which is an admin user btw. Please check my following approaches:
I tried to use apple script (see below) but I was only able to change the wallpaper of the user that I have the password to SSH.
osascript -e 'tell application "System Events" to set picture of every desktop to ("/path/to/picture.jpg" as POSIX file as alias)'
I tried the following command but nothing happened:
sqlite3 ~/Library/Application\ Support/Dock/desktoppicture.db "update data set value = '/path/to/picture.jpg'" && killall Dock;
Also tried this:
defaults write com.apple.desktop Background "{default = {ImageFilePath='/path/to/picture.jpg'; };}"; killall Dock
But seems like the setting is not stored in com.apple.desktop any more.
I tried to search for the wallpaper file location in finder but seems like the keyword does not appear in the file name - I tried to search for "desktop", "background" and "wallpaper".
I also did a file traction while I changed the wallpaper and then search for the keywords as well as looking at every jpg and png file. But I only found the login screen background picture.
Besides, I found the place to store the default desktop picture but seems like I cannot change it even as a SUDO user so if I want to make this I have to restart the machine;however, I don't want to interrupt the user