ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Zenity Login Dialog

    IT Discussion
    x2go zenity login dialog rhel
    1
    1
    1.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • stacksofplatesS
      stacksofplates
      last edited by stacksofplates

      So I have kind of a unique need. Due to circumstances beyond my control, we need a login banner displayed on our RHEL 6 systems. Usually /etc/issue and the message-banner on the login screen can take care of it. However we also need a dialog box to make the user accept the terms for the system. RHEL 5 had Gdialog but it's gone. So I used Zenity. We can edit the Default script in `/etc/gdm/PreSession/' and add:

      zenity --question --text="This is a super secure system. You give up your children and family to use it, yada yada. Do you accept?"
      
      userResponse=$?
      
      if [ $userResponse == "1" ]; then
            exit 1
      fi
      

      This takes care of the local logins, however X2Go doesn't use the GDM login so that doesn't help for remote logins. For X2Go what I figured out was if I edit the /usr/bin/x2goruncommand and change:

      if [ "$cmd" == "GNOME" ] || [ "$cmd" == "gnome-session" ]; then
          cmd="/usr/bin/gnome-session"
      

      to

      if [ "$cmd" == "GNOME" ] || [ "$cmd" == "gnome-session" ]; then
          cmd="my-custom-script"
      

      which calls this script:

      #!/bin/bash
      
      zenity --question --text="This is a super secure system. You give up your children and family to use it, yada yada. Do you accept?"
      
      userResponse=$?
      
      if [ $userResponse == "1" ]; then
            exit 1
      fi
      
      /usr/bin/gnome-session
      

      Then I get the popup through X2Go and if I hit "Cancel", it cancels the session, and if I hit "OK" it logs me in.

      This is using RHEL 6 systems. With Ubuntu the x2goruncommand does some crazy checking to see what version of Ubuntu you're running. If you're running Ubuntu, you'll need more debugging.

      1 Reply Last reply Reply Quote 2
      • 1 / 1
      • First post
        Last post