<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic su ,how ? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/su-how/m-p/2569697#M30370</link>
    <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;We know when you run "su " , the system will prompt you for passwd , after you type the correct root passwd , you will get the shell for root (The prompt is #)  .&lt;BR /&gt;&lt;BR /&gt;Here I want to implement such program named "chsu" so that certain persons need not type the root passwd to get root access when they execte chsu .&lt;BR /&gt;&lt;BR /&gt;I wrote a program in c ( chsu.c) with the "setuid(0)" in it and change the exection file(chsu) persion to 4755 , I can get the root permission , but not the same as execute "su" , for example , when you execute "su" , you get "#" for root . and the command "id" are different after you execte "chsu" and "su" .&lt;BR /&gt;&lt;BR /&gt;chsu.c&lt;BR /&gt;#######################&lt;BR /&gt;#include&lt;STDIO.H&gt;&lt;BR /&gt;#include&lt;STDLIB.H&gt;&lt;BR /&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;  &lt;BR /&gt;// if the user is granted to execute this program&lt;BR /&gt;// maybe can control by a file chsu.txt&lt;BR /&gt;// ....&lt;BR /&gt;        setuid(0);&lt;BR /&gt;        system("sh");&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;#######################################&lt;BR /&gt;&lt;BR /&gt;Any body can give hint to me ? such as how to write such a program,&lt;BR /&gt;or how to write a program like "su"&lt;BR /&gt;( I am not a C programer , so if you give me the source file , Great!!)&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;Frank Li&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;</description>
    <pubDate>Fri, 24 Aug 2001 07:59:02 GMT</pubDate>
    <dc:creator>Frank Li</dc:creator>
    <dc:date>2001-08-24T07:59:02Z</dc:date>
    <item>
      <title>su ,how ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-how/m-p/2569697#M30370</link>
      <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;We know when you run "su " , the system will prompt you for passwd , after you type the correct root passwd , you will get the shell for root (The prompt is #)  .&lt;BR /&gt;&lt;BR /&gt;Here I want to implement such program named "chsu" so that certain persons need not type the root passwd to get root access when they execte chsu .&lt;BR /&gt;&lt;BR /&gt;I wrote a program in c ( chsu.c) with the "setuid(0)" in it and change the exection file(chsu) persion to 4755 , I can get the root permission , but not the same as execute "su" , for example , when you execute "su" , you get "#" for root . and the command "id" are different after you execte "chsu" and "su" .&lt;BR /&gt;&lt;BR /&gt;chsu.c&lt;BR /&gt;#######################&lt;BR /&gt;#include&lt;STDIO.H&gt;&lt;BR /&gt;#include&lt;STDLIB.H&gt;&lt;BR /&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;  &lt;BR /&gt;// if the user is granted to execute this program&lt;BR /&gt;// maybe can control by a file chsu.txt&lt;BR /&gt;// ....&lt;BR /&gt;        setuid(0);&lt;BR /&gt;        system("sh");&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;#######################################&lt;BR /&gt;&lt;BR /&gt;Any body can give hint to me ? such as how to write such a program,&lt;BR /&gt;or how to write a program like "su"&lt;BR /&gt;( I am not a C programer , so if you give me the source file , Great!!)&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;Frank Li&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Fri, 24 Aug 2001 07:59:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-how/m-p/2569697#M30370</guid>
      <dc:creator>Frank Li</dc:creator>
      <dc:date>2001-08-24T07:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: su ,how ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-how/m-p/2569698#M30371</link>
      <description>&lt;BR /&gt;main( argc, argv ) {&lt;BR /&gt;&lt;BR /&gt;      setuid(0);&lt;BR /&gt;      execv( "/usr/bin/su", argv );&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;should do.&lt;BR /&gt;Klaus</description>
      <pubDate>Fri, 24 Aug 2001 09:28:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-how/m-p/2569698#M30371</guid>
      <dc:creator>Klaus Crusius</dc:creator>
      <dc:date>2001-08-24T09:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: su ,how ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-how/m-p/2569699#M30372</link>
      <description>Hello Frank,&lt;BR /&gt;&lt;BR /&gt;get a copy of "sudo", edit the "/etc/sudoers" config file&lt;BR /&gt;and live happily ever after ;-)&lt;BR /&gt;Do NOT go for your first attempt of your script, as that&lt;BR /&gt;is much (MUCH) to dangerous!!!&lt;BR /&gt;&lt;BR /&gt;Be careful,&lt;BR /&gt;  Wodisch</description>
      <pubDate>Fri, 24 Aug 2001 22:35:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-how/m-p/2569699#M30372</guid>
      <dc:creator>Wodisch</dc:creator>
      <dc:date>2001-08-24T22:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: su ,how ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/su-how/m-p/2569700#M30373</link>
      <description>Hi frank,&lt;BR /&gt;&lt;BR /&gt;I completely agree with Wodisch here. You can download sudo either from&lt;BR /&gt;&lt;A href="ftp://ftp.courtesan.com/sudo/dist/sudo-1.6.3p7.tar.gz" target="_blank"&gt;ftp://ftp.courtesan.com/sudo/dist/sudo-1.6.3p7.tar.gz&lt;/A&gt;&lt;BR /&gt;or in swinstall format&lt;BR /&gt;&lt;A href="http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sudo-1.6.2b1/" target="_blank"&gt;http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sudo-1.6.2b1/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The good thing using sudo, users can execute commands as other users or root, without knowing any other passwords beside their own&lt;BR /&gt;&lt;BR /&gt;-HTH&lt;BR /&gt;Ramesh</description>
      <pubDate>Sat, 25 Aug 2001 01:21:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/su-how/m-p/2569700#M30373</guid>
      <dc:creator>linuxfan</dc:creator>
      <dc:date>2001-08-25T01:21:43Z</dc:date>
    </item>
  </channel>
</rss>

