The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
dialog menu script. please HELP claudlu Shell Programming and Scripting 2 05-04-2008 07:11 AM
html problem: get file name dialog exists? f33ldead Shell Programming and Scripting 0 02-25-2008 05:48 PM
perl progress bar dialog fed.linuxgossip Shell Programming and Scripting 4 09-18-2007 07:40 AM
dialog output dhinge UNIX for Dummies Questions & Answers 2 11-30-2006 10:20 AM
two computers - one modem Pennywize UNIX for Dummies Questions & Answers 3 11-27-2002 02:37 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #29  
Old 11-09-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
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"
Reply With Quote
Forum Sponsor
  #30  
Old 11-09-2007
Registered User
 

Join Date: Sep 2007
Location: EX-PAT in Taipei, Taiwan
Posts: 105
sweet that worked perfect thank you very much.
Reply With Quote
  #31  
Old 11-09-2007
Registered User
 

Join Date: Sep 2007
Location: EX-PAT in Taipei, Taiwan
Posts: 105
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
Reply With Quote
  #32  
Old 11-09-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
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 12:40 AM.
Reply With Quote
  #33  
Old 11-09-2007
Registered User
 

Join Date: Sep 2007
Location: EX-PAT in Taipei, Taiwan
Posts: 105
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.
Reply With Quote
  #34  
Old 11-09-2007
Registered User
 

Join Date: Sep 2007
Location: EX-PAT in Taipei, Taiwan
Posts: 105
Ok here is a screen shot of me on the local client launching that application i am talking about.


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
Reply With Quote
  #35  
Old 11-09-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by deaconf19 View Post
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
export display, inappropriate ioctl for device

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:32 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0