Automating tasks with SSH, Zenity, Yad, KDialog, PuTTY, WinSCP, and Rex
Self-Service
© Robert Klein, 123RF.com
Starting a script on a Linux server with just a few mouse clicks sounds more complicated than it really is. If you want to create attractive and interactive dialogs for your desktop users, all you need is a small utility called SSH and a little Bash know-how.
Deleting all the tasks in the print spool or saving a complete backup to the SAN immediately after finishing a large project are all typical tasks that keep systems administrators from getting their real work done. How much easier it would be if they could enable their users to complete selected administrative tasks themselves.
To allow even inexperienced users to accomplish these housekeeping chores, admins can simply place an appropriate icon on their desktops. With it, the user starts a self-made program with a simple but sufficient GUI, which in turn triggers actions on the Linux server via SSH – also via script. If admins have SSH, sudo, and one of the dialog systems described below (Zenity, Yad, KDialog, or Rex) in their tool boxes, the client users don't have to grapple with Linux concepts. Windows clients have PuTTY, WinSCP, or PowerShell.
Master of the Keys
For this scenario to work, users must have SSH keys on their clients that serve as authorization for the Linux server. Although it would also work with the customary login and password combination, you can save yourself the typing with the key setup. A pair of local keys is generated with ssh-keygen, which immediately asks for a location to save the keys and a key passphrase. Safety-conscious admins will also assign a password for access to the key, but that step can be left out (see the box "Secure Agent"). With a private and a public key now stored under ~/.ssh, the public key is copied to the SSH server with:
[...]
Buy this article as PDF
(incl. VAT)
