Automating tasks with SSH, Zenity, Yad, KDialog, PuTTY, WinSCP, and Rex

Self-Service

© Robert Klein, 123RF.com

© Robert Klein, 123RF.com

Article from Issue 146/2013
Author(s):

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:

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Script Dialogs

    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.

  • Zenity and KDialog

    Zenity and KDialog let you integrate your scripts with the native KDE or Gnome environment.

  • Workspace: Text Expander

    A couple of utilities and a dash of Bash scripting are all you need to roll out a simple yet flexible text expander.

  • Zenity Dialogs

    The Zenity command-line utility lets you create simple dialog boxes with your own data or with the output of utilities and applications.

  • Dress Up Bash Scripts with YAD
comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News