LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-31-2012, 08:59 AM   #1
simonb
LQ Newbie
 
Registered: Dec 2002
Posts: 11

Rep: Reputation: 0
"su: must be run from a terminal" How best for root to run command as user


I have a script that runs as root and needs to execute a command as another user. However, it seems that newer versions of su won't let me do that. I get the message...

"su: must be run from a terminal"

I can understand the security issue of allowing a normal user to su when not in a terminal, but why is root blocked from running as a normal user??? Is there any reason why there is not an excemption for root?

The command I would like to run is to check Zimbra status for nagios/nrpe.

su - zimbra -c "zmcontrol status"

Is there any workaround to enable root to execute the above command?

Thanks

Update:
I've just realised that the script wasn't being run as root. So it obviously wouldn't work!

Please ignore

Last edited by simonb; 03-31-2012 at 09:06 AM.
 
Old 04-01-2012, 02:40 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Good to see you figured out what was wrong and added this info to your thread.

Ignoring it by taking this of the zero reply list......
 
  


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
[SOLVED] How do I run "menu" and "logout" from the command line in fluxbox? psionl0 Slackware 19 03-02-2011 12:46 AM
Net-SNMP - Run a command as root with "extend" feature gimpy530 Linux - Software 0 07-13-2010 09:03 PM
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 07:42 AM
Can double-click the shell script and choose "Run in Terminal" in Redhat? edwardsiow Programming 2 05-22-2006 08:56 PM
Can't run "halt" or "reboot" as user, can somebody help? ro_nicu Slackware 4 11-01-2004 07:57 AM


All times are GMT -5. The time now is 06:33 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration