LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-05-2011, 07:01 PM   #1
LexLuthar
LQ Newbie
 
Registered: May 2011
Posts: 2

Rep: Reputation: 0
Screen - Multiuser access + Start as root from other users


Hi!

I am trying to figure out how to write a bash script to start a screen session, turn multi-user on, allow about 11 users access to this screen, and then execute a command to startup our game server.
It will need to be run as root (only way to start the game properly), but the script may be executed by a user other than the root account (I also only want the user to be able to run the one line of code to start the server, and not be able to do the other fun things the root account can do)

Any ideas on how I would go about doing this?

Cheers!
-A
 
Old 05-07-2011, 06:30 AM   #2
gnuweenie
Member
 
Registered: Oct 2010
Posts: 35

Rep: Reputation: Disabled
You can run something like this to prompt for the root password, and then launch a detached screen session with the command start_game_server executed within:
Code:
gksu -u root 'screen -S gameOn -md start_game_server'&
To turn on multiuser mode, you can either do this in a screenrc config file (before launch), or you can send the command externally this way, after it has been started:

as root:
Code:
screen -X multiuser on
as user who needs to login as root:
Code:
gksu -u root 'screen -X multiuser on'
Root can add users like this:
Code:
screen -X addacl bob
screen -X aclchg bob -w 0
screen -X addacl mindy
screen -X aclchg mindy -w 0
screen -X addacl peter
screen -X aclchg peter -w 0
That should give user visibility to the window, but no obvious way of executing a command as root. The user list can also be configured in the screenrc config file.
 
Old 05-08-2011, 02:16 AM   #3
LexLuthar
LQ Newbie
 
Registered: May 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Awesome thanks!
So, what would a screenrc config file look like?
I looked at the file, But I was confused as to how to add the specific lines to the file, and how they should be implemented.

Thanks!
-A
 
Old 05-09-2011, 09:59 AM   #4
gnuweenie
Member
 
Registered: Oct 2010
Posts: 35

Rep: Reputation: Disabled
Quote:
Originally Posted by LexLuthar View Post
Awesome thanks!
So, what would a screenrc config file look like?
I looked at the file, But I was confused as to how to add the specific lines to the file, and how they should be implemented.

Thanks!
-A
You just add the commands to the file as you would type them at the screen command prompt, one command per line. A config file could look like this:
Code:
multiuser on
addacl bob
aclchg bob -w 0
addacl mindy
aclchg mindy -w 0
addacl peter
aclchg peter -w 0
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
software to access file system.. how to allow access for non root users? stdcinout Linux - Newbie 8 03-09-2010 12:55 PM
users with root access? ginda Linux - Security 1 08-20-2007 06:01 AM
How to allow modem access to non-root users tadelste JDS 0 10-19-2004 04:39 PM
How can root start programs in the name of other users? J_Szucs Linux - Newbie 3 09-12-2003 01:59 PM
non-root users inet access Duckus Linux - Newbie 4 06-05-2003 10:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:49 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