<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">This work correctly.  Thanks.<br><br>--- <b>10/8/19 (四),John Kennedy <i><skebi69@gmail.com></i></b> 寫道:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>寄件者: John Kennedy <skebi69@gmail.com><br>主旨: Re: [CentOS] how to setup account which can 'su" to another account (NON-root)?<br>收件者: "CentOS mailing list" <centos@centos.org><br>日期: 2010年8月19日,四,上午10:00<br><br><div id="yiv452415853"><br><br><div class="yiv452415853gmail_quote">On Thu, Aug 19, 2010 at 9:56 AM, mcclnx mcc <span dir="ltr"><<a rel="nofollow" ymailto="mailto:mcclnx@yahoo.com.tw" target="_blank" href="/mc/compose?to=mcclnx@yahoo.com.tw">mcclnx@yahoo.com.tw</a>></span> wrote:<br><blockquote class="yiv452415853gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px
 solid rgb(204, 204, 204); padding-left: 1ex;">
Thank you for answer.  The problem I have is "user1" need "su" privilege.  If I grant "su" privilege, it can "su" to anyone.  What I want is user1 can ONLY "su" to user2.<br>

<br>
my /etc/sudoers setup:<br>
<br>
  # User privilege specification<br>
root    ALL=(ALL) ALL<br>
user1   ALL=(root) /bin/su<br>
<br>
<br>
any ideal to fix it?<br>
<br>
<br><br></blockquote><div><br></div><div>Use complete command like this:</div><div>user1 ALL=(root) /bin/su - user2</div><div>This will limit user1 to that specific command. You can add -NOPASSWD and user1 will not have to enter their password.</div>
<div>John</div></div>-- <br> John Kennedy<br><br>
</div><br>-----內含下列夾帶檔案-----<br><br><div class="plainMail">_______________________________________________<br>CentOS mailing list<br><a ymailto="mailto:CentOS@centos.org" href="/mc/compose?to=CentOS@centos.org">CentOS@centos.org</a><br><a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br></div></blockquote></td></tr></table><br>