<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/default.xsl"?>
<fr:tree xmlns:fr="http://www.forester-notes.org" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xml="http://www.w3.org/XML/1998/namespace" root="false" base-url="/">
  <fr:frontmatter>
    <fr:authors>
      <fr:author>
        <fr:link href="/aram/" title="Aram Hăvărneanu" uri="https://xw.is/aram/" display-uri="aram" type="local">Aram Hăvărneanu</fr:link>
      </fr:author>
    </fr:authors>
    <fr:date>
      <fr:year>2018</fr:year>
      <fr:month>6</fr:month>
      <fr:day>7</fr:day>
    </fr:date>
    <fr:uri>https://xw.is/0009/</fr:uri>
    <fr:display-uri>0009</fr:display-uri>
    <fr:route>/0009/</fr:route>
    <fr:title text="Solaris › Create a new administrative user in Solaris"><fr:link href="/solaris-index/" title="Solaris" uri="https://xw.is/solaris-index/" display-uri="solaris-index" type="local">Solaris</fr:link> › Create a new administrative user in <fr:link href="/solaris/" title="Solaris" uri="https://xw.is/solaris/" display-uri="solaris" type="local">Solaris</fr:link></fr:title>
  </fr:frontmatter>
  <fr:mainmatter>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="/aram/" title="Aram Hăvărneanu" uri="https://xw.is/aram/" display-uri="aram" type="local">Aram Hăvărneanu</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2018</fr:year>
          <fr:month>6</fr:month>
          <fr:day>7</fr:day>
        </fr:date>
        <fr:title text="Ensure &quot;Primary Administrator&quot; profile exist">Ensure "Primary Administrator" profile exist</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>Make sure <html:code>Primary Administrator</html:code> profile exists and the current user is assigned to it.</html:p>
        <fr:tree show-metadata="false" expanded="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/aram/" title="Aram Hăvărneanu" uri="https://xw.is/aram/" display-uri="aram" type="local">Aram Hăvărneanu</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2018</fr:year>
              <fr:month>6</fr:month>
              <fr:day>7</fr:day>
            </fr:date>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>7</fr:month>
              <fr:day>8</fr:day>
            </fr:date>
            <fr:uri>https://xw.is/0007/</fr:uri>
            <fr:display-uri>0007</fr:display-uri>
            <fr:route>/0007/</fr:route>
            <fr:title text="Solaris › Re-add &quot;Primary Administrator&quot; in Solaris 11"><fr:link href="/solaris-index/" title="Solaris" uri="https://xw.is/solaris-index/" display-uri="solaris-index" type="local">Solaris</fr:link> › Re-add "Primary Administrator" in <fr:link href="/solaris11/" title="Oracle Solaris 11" uri="https://xw.is/solaris11/" display-uri="solaris11" type="local">Solaris 11</fr:link></fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p><fr:link href="/solaris/" title="Solaris" uri="https://xw.is/solaris/" display-uri="solaris" type="local">Solaris</fr:link> used to ship with a <html:code>Primary Administrator</html:code> <fr:link href="/solaris-rbac/" title="Solaris Roles, Rights Profiles, and Privileges" uri="https://xw.is/solaris-rbac/" display-uri="solaris-rbac" type="local">RBAC</fr:link> <fr:link href="https://docs.oracle.com/cd/E23824_01/html/821-1456/rbac-1.html#rbac-33" type="external">profile</fr:link>, but it was removed some time in <fr:link href="/solaris11/" title="Oracle Solaris 11" uri="https://xw.is/solaris11/" display-uri="solaris11" type="local">Solaris 11</fr:link>. We can easily add it back to the <fr:link href="/prof_attr.5" title="prof_attr(5)" uri="https://xw.is/prof_attr.5" display-uri="prof_attr.5" type="local">profile description</fr:link> and to the <fr:link href="/exec_attr.5" title="exec_attr(5)" uri="https://xw.is/exec_attr.5" display-uri="exec_attr.5" type="local">execution profile</fr:link> databases. After this, we can run <fr:link href="/pfexec.1" title="pfexec(1)" uri="https://xw.is/pfexec.1" display-uri="pfexec.1" type="local">pfexec(1)</fr:link> without a password.</html:p>
            <html:p>Run the following as <html:code>root</html:code>:</html:p>
            <html:pre>echo 'Primary Administrator:suser:cmd:::*:uid=0;gid=0' &gt;&gt; /etc/security/exec_attr
echo 'Primary Administrator:::All administrative tasks:auths=solaris.*;solaris.grant;help=RtPriAdmin.html' &gt;&gt; /etc/security/prof_attr
usermod -P "Primary Administrator" aram</html:pre>
          </fr:mainmatter>
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="/aram/" title="Aram Hăvărneanu" uri="https://xw.is/aram/" display-uri="aram" type="local">Aram Hăvărneanu</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2018</fr:year>
          <fr:month>6</fr:month>
          <fr:day>7</fr:day>
        </fr:date>
        <fr:title text="Create the new user">Create the new user</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:pre>pfexec useradd -u 5008 -g staff -s /bin/bash -m -P 'Primary Administrator' -K 'defaultpriv=basic,dtrace_proc,dtrace_user' foo
pfexec passwd -N foo</html:pre>
      </fr:mainmatter>
    </fr:tree>
  </fr:mainmatter>
  <fr:backmatter>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="References">References</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Context">Context</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Backlinks">Backlinks</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Related">Related</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>https://xw.is/solaris/</fr:uri>
            <fr:display-uri>solaris</fr:display-uri>
            <fr:route>/solaris/</fr:route>
            <fr:title text="Solaris">Solaris</fr:title>
            <fr:taxon>Software</fr:taxon>
            <fr:meta name="external">https://www.oracle.com/solaris</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Proprietary Unix operating system originally developed by <fr:link href="/sun/" title="Sun Microsystems" uri="https://xw.is/sun/" display-uri="sun" type="local">Sun Microsystems</fr:link>.</html:p>
          </fr:mainmatter>
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Contributions">Contributions</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
  </fr:backmatter>
</fr:tree>
