<?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 Re: user creation in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701280#M57940</link>
    <description>hi,&lt;BR /&gt;&lt;BR /&gt; You can use execve system call and pass the parameters /usr/sbin/useradd and its arguments to the system call.  You can make this a setuserid script , such that non-root user can run it.&lt;BR /&gt;&lt;BR /&gt;But, be sure it is offbounds from regular users.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;raj</description>
    <pubDate>Thu, 11 Apr 2002 10:49:33 GMT</pubDate>
    <dc:creator>Roger Baptiste</dc:creator>
    <dc:date>2002-04-11T10:49:33Z</dc:date>
    <item>
      <title>user creation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701274#M57934</link>
      <description>How can create a new unix user from C code process: &lt;BR /&gt;- the function to use&lt;BR /&gt;- the security problems.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Apr 2002 09:51:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701274#M57934</guid>
      <dc:creator>Dakka</dc:creator>
      <dc:date>2002-04-11T09:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: user creation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701275#M57935</link>
      <description>do a system() call passing parameters to useradd - see man pages.&lt;BR /&gt;&lt;BR /&gt;I would not recommend any other method, because if you toast the passwd file, you toast your system.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Thu, 11 Apr 2002 09:58:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701275#M57935</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-04-11T09:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: user creation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701276#M57936</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;make sure you make a backup of the /etc/passwd file before you do anything at all.&lt;BR /&gt;&lt;BR /&gt;just in case !!!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cheers&lt;BR /&gt;John.</description>
      <pubDate>Thu, 11 Apr 2002 10:04:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701276#M57936</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2002-04-11T10:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: user creation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701277#M57937</link>
      <description>what about the permission ?&lt;BR /&gt;useradd should be executed by root. What to do if the process isnot root owner.&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Apr 2002 10:23:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701277#M57937</guid>
      <dc:creator>Dakka</dc:creator>
      <dc:date>2002-04-11T10:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: user creation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701278#M57938</link>
      <description>Probably the easiest way would be - as mentioned by others - to do a system() syscall for the SysV-common useradd command.&lt;BR /&gt;However, if you so desire, basically it's more or less just updating the right files (mainly /etc/passwd, but caveat trusted system shadow files etc.), creating the home directories for the new accounts, changing ownership and permission bits accordingly, and providing them with a bunch of dot files from e.g. /etc/skel.&lt;BR /&gt;For instance a FreeBSD system provides a Perl script called adduser which exactly does these things, so it's not much different implementing these steps in C.&lt;BR /&gt;Just get hold of the adduser script to get an idea.</description>
      <pubDate>Thu, 11 Apr 2002 10:29:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701278#M57938</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2002-04-11T10:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: user creation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701279#M57939</link>
      <description>&lt;BR /&gt;The danger of writing your own "user creation" program, is that you HAVE NO ROOM for ERROR. If you toast the /etc/passwd file, yuou can kiss your system goodbye.&lt;BR /&gt;&lt;BR /&gt;Use the useradd command via system(). Make YOUR "c" program a root setuid program.&lt;BR /&gt;&lt;BR /&gt;Like this:&lt;BR /&gt;&lt;BR /&gt;chown root:bin myuseracctprog&lt;BR /&gt;chmod 4555 myuseracctprog&lt;BR /&gt;&lt;BR /&gt;BTW, make sure you send emails to the system's admin's so they know who is doing what, and when they are doing it.&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Thu, 11 Apr 2002 10:34:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701279#M57939</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-04-11T10:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: user creation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701280#M57940</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt; You can use execve system call and pass the parameters /usr/sbin/useradd and its arguments to the system call.  You can make this a setuserid script , such that non-root user can run it.&lt;BR /&gt;&lt;BR /&gt;But, be sure it is offbounds from regular users.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;raj</description>
      <pubDate>Thu, 11 Apr 2002 10:49:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701280#M57940</guid>
      <dc:creator>Roger Baptiste</dc:creator>
      <dc:date>2002-04-11T10:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: user creation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701281#M57941</link>
      <description>Strictly the way to do this from C is to use the standard posix libraries and the HP extensions from trusted systems, eg:&lt;BR /&gt;&lt;BR /&gt;#include &lt;PWD.H&gt;&lt;BR /&gt;#include &lt;PROT.H&gt;&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;/* Is the system trusted? */&lt;BR /&gt;int trusted=iscomsec(void);&lt;BR /&gt;&lt;BR /&gt;int create_user(char *name, char *pw, uid_t uid, gid_t gid,char *gecos, char *dir, char *shell)&lt;BR /&gt;{&lt;BR /&gt;   passwd new_pwd;&lt;BR /&gt;   FILE *pwd_file;&lt;BR /&gt;   /* security checks go here, eg uid != 0 */&lt;BR /&gt;   pwd_file=fopen("/etc/passwd","rw");&lt;BR /&gt;&lt;BR /&gt;   strcpy(new_pwd.pw_name,name);&lt;BR /&gt;   strcpy(new_pwd.pw_passwd,pw);&lt;BR /&gt;   /* ad nauseum */&lt;BR /&gt;   if (trusted)&lt;BR /&gt;   {&lt;BR /&gt;    ... add trusted defaults here&lt;BR /&gt;   }&lt;BR /&gt;&lt;BR /&gt;   putpwent(new_pwd, pwd_file);&lt;BR /&gt;   if (trusted) putprpwent(newpr_pwd);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;The above is *very* cut down and misses out a lot, especially in checks...&lt;BR /&gt;&lt;BR /&gt;Have a look at the following man pages:&lt;BR /&gt;* putpwent&lt;BR /&gt;* getpwent&lt;BR /&gt;* iscomsec&lt;BR /&gt;* putprpwent&lt;BR /&gt;* getprpwent&lt;BR /&gt;&lt;BR /&gt;Be warned though; you have to be anal about the uid and gid settings, I'd advise banning *anything* under 100.&lt;BR /&gt;&lt;BR /&gt;You could also use execv to run a useradd command, but again you will needed to anally check the input...&lt;BR /&gt;&lt;BR /&gt;dave&lt;/PROT.H&gt;&lt;/PWD.H&gt;</description>
      <pubDate>Thu, 11 Apr 2002 11:03:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/user-creation/m-p/2701281#M57941</guid>
      <dc:creator>David Lodge</dc:creator>
      <dc:date>2002-04-11T11:03:41Z</dc:date>
    </item>
  </channel>
</rss>

