LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-19-2009, 09:26 AM   #1
Sturmovik
LQ Newbie
 
Registered: Nov 2009
Posts: 1

Rep: Reputation: 0
Question Displaying Graphical Output from a PAM called Shell Script


Before I begin I would like to say that while I am not a Linix newbie, I am not a guru or even a regular user so don't assume I have anything more than general Linux knowledge.

I am carrying out research involving virtualization and Single Sign On technologies and I need to display a Xen based virtual machine to the desktop before the user is logged in. This is for a demonstration system and I am trying to find a solution that involves the least amount of system modification possible.

I found a PAM module that allows for the invocation of arbitrary shell scripts which would allow me to start and display the virtual machine in question, but when trying to run the virt viewer (or any process with graphical output) I am informed that the display cannot be found. Explicitly setting the DISPLAY env to :0 before running the command has no effect.

This is where my Linux knowledge runs out. I know that there has to be some way to connect to the X session being used by the greeter, I just don't know what that method involves. The shell script is running with root privileges, so it can access whatever "X credentials" are stored locally.

I will be thankful for any assistance this forum might be able to provide, but please do not suggest alternatives to displaying a VM for my SSO needs, and please avoid any solution that involves having to write my own custom greeter. If there is absolutely no way to accomplish what I am trying to do without greeter modifications definitely tell me, but I am a security researcher, not a Linux developer so I am looking for the easiest solution to implement, even if that solution is a gross hack.

Thanks in advance.
 
Old 11-26-2009, 05:45 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
You could try setting up the host to auto-login as a particular user and change that users shell to be a specific command

Code:
perl -pi -e 's/^1:2345:respawn:\/sbin\/mingetty\s+tty1/1:2345:respawn:\/sbin\/mingetty --noclear --autologin user1 tty1/' /etc/inittab
Code:
usermod -s /path/to/my/script user1
let us know how you go

cheers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script: can you tell if a script is called via an alias? BrianK Programming 11 10-01-2009 11:16 AM
Linux based java decompiler to be called from shell script rakeshrau Linux - Newbie 2 06-25-2009 08:40 AM
custom shell script interpreter is not called on my vserver empgodot Linux - Server 2 05-31-2009 07:40 AM
shell script output redirection goral.j Programming 3 01-27-2005 05:34 AM
Writing shell script called "convert" bluewolf Programming 3 02-04-2003 10:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration