My home media is on a Plex installation running on a headless server in my (detached) home office, and my wife recently arranged to copy some content onto a USB drive for a friend.

To make it easier for her to transfer the media to the USB drive, I wrote up a script, as follows:

Then I created a local shell account for her, and appended the following to ~/.bash_profile, so that the script could only run once, and she could (theoretically) drive it from her laptop or her phone:

# Launch tmux session
[ -z "$TMUX"  ] && { tmux attach || exec tmux new-session 'sudo /root/scripts/' && exit;}

Finally, I created /etc/sudoers.d/wifeysaurus, setting up sudo access:

wifeysaurus ALL= NOPASSWD: /root/scripts/

On her (Mac) laptop, I opened, ran ssh-keygen (no password) followed by ssh-copy-id <servername>, to setup passwordless SSH.

Finally, I temporarily aliased ilovedave to ssh <servername>, and now she’s happily sitting on the couch and transferring content, without having to worry about driving the underlying CentOS6 OS ?

You’ve successfully subscribed to πŸ§‘β€πŸ’» Funky Penguin
Welcome back! You’ve successfully signed in.
Great! You’ve successfully signed up.
Your link has expired
Success! Check your email for magic link to sign-in.