sudo: sorry, you must have a tty to run sudo

原贴:http://www.zimbra.com/forums/installation/10553-solved-sudo-sorry-you-must-have-tty-run-sudo.html

Welcome to the Zimbra - Forums.
Welcome to the forums! We encourage you to explore all things Zimbra with our team and members of the community. If you would like to post a comment, please register and review our posting policy & tips.

Reply
 
LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-31-2007, 11:44 AM
Member
 
Join Date: Jul 2007
Posts: 21
BlueHaven is on a distinguished road
Default[SOLVED] sudo: sorry, you must have a tty to run sudo

Running the config and get this error when Initializing ldap


sudo: sorry, you must have a tty to run sudo

Any idea's?

Still on fedora 6
Reply With Quote
  #2 (permalink)  
Old 07-31-2007, 11:50 AM
mmorse's Avatar
Zimbra Employee
 
Join Date: May 2006
Location: USA
ZCS Version: 6.0.x - NE & FOSS
Posts: 5,431
mmorse is on a distinguished road
Send a message via AIM to mmorse Send a message via MSN to mmorse Send a message via Yahoo to mmorse Send a message via Skype™ to mmorse
Default

Fedora's has some additional restrictions
As root:
./install.sh -u
vi /etc/sudoers (EDIT: please use visudo instead)
comment out: #Default requiretty
And reinstall (./install.sh)

If requiretty is set, sudo will only run when the user is logged in to a real tty. This will disallow things like 'rsh somehost sudo ls' since rsh does not allocate a tty; because it is not possible to turn off echo when there is no tty present.

Last edited by mmorse : 07-31-2007 at 12:26 PM. Reason: visudo
Reply With Quote
  #3 (permalink)  
Old 07-31-2007, 11:56 AM
mmorse's Avatar
Zimbra Employee
 
Join Date: May 2006
Location: USA
ZCS Version: 6.0.x - NE & FOSS
Posts: 5,431
mmorse is on a distinguished road
Send a message via AIM to mmorse Send a message via MSN to mmorse Send a message via Yahoo to mmorse Send a message via Skype™ to mmorse
Default

I knew there was a safer method: visudo
Sudoers - ZimbraWiki
Reply With Quote
  #4 (permalink)  
Old 07-31-2007, 12:09 PM
Member
 
Join Date: Jul 2007
Posts: 21
BlueHaven is on a distinguished road
Default

Hmm, well the first way you showed me worked good. Sense this is only a test box I will leave it as is. If I decide to go production I will prop it the way in the article!

Thanks a bunch!!!!
Reply With Quote
  #5 (permalink)  
Old 07-31-2007, 12:32 PM
mmorse's Avatar
Zimbra Employee
 
Join Date: May 2006
Location: USA
ZCS Version: 6.0.x - NE & FOSS
Posts: 5,431
mmorse is on a distinguished road
Send a message via AIM to mmorse Send a message via MSN to mmorse Send a message via Yahoo to mmorse Send a message via Skype™ to mmorse
Default

Good to hear,
visudo is just a little safer than a vi no biggie
It essentially locks the sudoers file, provides basic sanity/parse errors checks.
Reply With Quote
  #6 (permalink)  
Old 02-11-2009, 07:05 PM
Starter Member
 
Join Date: Feb 2009
Posts: 1
sir_hmba is on a distinguished road
Default

Quote:
Originally Posted by mmorse View Post
comment out: #Default requiretty
Instead of removing the requiretty default for everyone you can selectively override defaults for users/groups. I'm not sure if the original poster was having trouble w/ the ldap user account, but I'll assume he was. In that case:

Code:
Defaults:ldap   !requiretty
See the examples section of the sudoers(5) man page for more information.

没有更多推荐了,返回首页