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

来源:互联网 发布:php baseurl 编辑:程序博客网 时间:2024/05/16 23:02

原贴: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
BlueHaven BlueHaven is offline
Member
BlueHaven's Zimbra Wiki Sandbox Page
 
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
mmorse mmorse is offline
Zimbra Employee
mmorse's Zimbra Wiki Sandbox Page
 
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.
__________________
-Mike

Coolest thing ever | ZCS-to-ZCS Migrations | Admin Tools & Tidbits - Part 2 » Zimbra :: Blog | 5.0.15NE/.14FOSS Available

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
mmorse mmorse is offline
Zimbra Employee
mmorse's Zimbra Wiki Sandbox Page
 
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
__________________
-Mike

Coolest thing ever | ZCS-to-ZCS Migrations | Admin Tools & Tidbits - Part 2 » Zimbra :: Blog | 5.0.15NE/.14FOSS Available
Reply With Quote
  #4 (permalink)  
Old 07-31-2007, 12:09 PM
BlueHaven BlueHaven is offline
Member
BlueHaven's Zimbra Wiki Sandbox Page
 
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
mmorse mmorse is offline
Zimbra Employee
mmorse's Zimbra Wiki Sandbox Page
 
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.
__________________
-Mike

Coolest thing ever | ZCS-to-ZCS Migrations | Admin Tools & Tidbits - Part 2 » Zimbra :: Blog | 5.0.15NE/.14FOSS Available
Reply With Quote
  #6 (permalink)  
Old 02-11-2009, 07:05 PM
sir_hmba sir_hmba is offline
Starter Member
sir_hmba's Zimbra Wiki Sandbox Page
 
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.