Pop up dialog box on remote computers


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Pop up dialog box on remote computers
# 29  
Old 11-09-2007
But your intention is to log into the server as each of the users?

Imagine this....

1. when the user logins in CDE or Gnome will run a login script of some kind (don't know what at the moment). This needs to capture the DISPLAY variable and put it somewhere.

Code:
echo $DISPLAY >$HOME/.CURRENT_DISPLAY

2. then each of the users needs in their $HOME/.ssh/authorized_keys a line which lets you run a small script (TellMe) on their behalf as them.

3. the "TellMe" script will then pull out the DISPLAY variable value from where ever it was hidden and then call your /h/test/bin/Msg, eg

TellMe:

Code:
#!/bin/sh
DISPLAY=`cat $HOME/.CURRENT_DISPLAY`
export DISPLAY
/h/test/bin/Msg $@

4. You call the program using

Code:
ssh -i my_identity person@server "\"Time for bed\" said Zeberdee"

# 30  
Old 11-09-2007
sweet that worked perfect thank you very much.
# 31  
Old 11-09-2007
sorry it did not work. the code for the display works. i created a login script and it creates the info and in there it is 0.0

the i created tellme. but when i run it. It tells me what the Msg program is for and how to use it.

and the ssh i am not that familiar with

i tried this with my user that is on all machines
ssh -i sysadmin oc01@test004 "\"time for bed\" said Bob"
ssh -i sysadmin oc01 "\"time for bed\" said Bob"

none of them worked thanks though

one more thing when i sub in "test" for the $@ the pop up dialog shows on my local screen
# 32  
Old 11-09-2007
Did you

(a) set up a key pair without password using sshkeygen?

(b) add an entry into $HOME/.ssh/authorized_keys with the public key and the name of the script to run (/some/path/TellMe)

(c) pass the private key filename as the -i parameter?

http://www.cit.gu.edu.au/~anthony/info/apps/ssh.hints

Quote:
Ssh Server, Limit what commands will work...

In the ".ssh/authorized_keys" file you can define a key as

command="/path/to/some/command args..." ssh-dss ...

Ensure it remains all on one line. This will force ssh to only execute the
command that was given, and NOT the command actually requested by the client.

Last edited by porter; 11-09-2007 at 04:40 AM..
# 33  
Old 11-09-2007
thanks but that is getting way to technical for what i want to do. if i figure it out i will post it here thanks for all your help.
# 34  
Old 11-09-2007
Ok here is a screen shot of me on the local client launching that application i am talking about.
Image

see how when insert the message then click enter it will display that pop up dialog. I now need to get that application to run and display the message locally on each machine.

i am logged on as a normal user account. fyi
# 35  
Old 11-09-2007
Quote:
Originally Posted by deaconf19
I now need to get that application to run and display the message locally on each machine.
.... and I suggest that you run the application as each user (using ssh)

(a) in order comply with the X security model.

(b) to get the true DISPLAY variable that the user is using

... and in order to run as each user you should use an authorized_keys entry

(a) to let you run something as that person

(b) as those people wouldn't want you running any old command on their behalf.

If you are thinking about using rsh then consider using ssh instead.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Require input in bash dialog box

Hello. Any help would be greatly appreciated. Right now I have the following input box that works fine and well, however I would like to wrap this is a loop that requires input. Right now the script will happily continue on if the user just hits enter. I'd like to require a minimum of a 5... (5 Replies)
Discussion started by: woodson2
5 Replies

2. Web Development

Pop up confirmation box / perl cgi

Hi, I need to add confirmation pop up msg box before deleting the record from database, I have added following snippets to my code but its not working for me, your help will be much appreciated : print header; print <<EOF; <script type="text/javascript"> function confirmOk() { return... (0 Replies)
Discussion started by: terrykhatri531
0 Replies

3. Shell Programming and Scripting

Dialog box in korn shell scripting

Does dialog box works on all kind of shells? I am using korn shell in Linux . For me dialog is not working :) is there any particular syntax or do we need to have particular OS version or shell env? #!/bin/ksh dialog --title "create file" \ --backtitle "shell script practice" \... (1 Reply)
Discussion started by: NarayanaPrakash
1 Replies

4. UNIX for Dummies Questions & Answers

Dialog box

I know, I can run dialog command in my machine. But what I want to do is I wanna show the dialog box to some other Remote host. I connected to the remote system and used dialog command its shows the box in my terminal only. How can I display to that remote machine?? Any suggestions??? (3 Replies)
Discussion started by: Adhi
3 Replies

5. Shell Programming and Scripting

How to create multiple input box in same window using dialog

Hi All, I was trying to generate GUI using shell script. After long search I found the utility called “dialog”. Using this utility I am able to generate window to collect the input. dialog --inputbox "Input 1" 10 45 dialog --inputbox "Input 2" 10 45 dialog --inputbox "Input 3" 10 45 Using... (2 Replies)
Discussion started by: kalpeer
2 Replies

6. Red Hat

Authentication Failed Dialog Box on Redhat 4.7

For some reason i cannot login using root or other accounts on my Linux system. When logging in at the main console it says "Authentication failed" in a dialog box with an OK button. The Linux system is Redhat 4.7. I've already checked /etc/pam.d/login, /etc/security/access.conf and ... (27 Replies)
Discussion started by: redhatuser2012
27 Replies

7. Shell Programming and Scripting

Script to display a dialog box every 5 seconds

I want to create a script that displays a dialog box every interval of time and exits that loop when a user presses ENTER Any idies? (4 Replies)
Discussion started by: amitlib
4 Replies

8. Debian

Dialog box in debconf file.

Hi all, I am working with debconf file for packaging the projects. I have used the ". /usr/share/debconf/confmodule" file to do the packaging in debian standard. It worked fine. When ever I am installing the package in apt-get the dialogs are come as I mentioned in the templates file.... (0 Replies)
Discussion started by: Nila
0 Replies

9. Web Development

Pop up Confirmation Box

Hi, I was writing a simple web application using Perl -CGI. When users try to do some operations, I wanted like a pop-up confirmation box. Is this possible with Perl-CGI? Thanks in advance. Regards, garric (6 Replies)
Discussion started by: garric
6 Replies

10. Shell Programming and Scripting

Displaying a dialog box using terminal commands

Hello, I used the command osascript -e 'tell app "Finder" to display dialog "Hey!"' to display a dialog box..it works fine, it displays a dialog box with 'OK' and 'CANCEL' buttons..i want to get the button returned value how can i do that using terminal command? is there any command to get... (1 Reply)
Discussion started by: keshav.murthy@r
1 Replies
Login or Register to Ask a Question