<?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: Root login in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/root-login/m-p/2554276#M28537</link>
    <description>Just a couple of thoughts, probably red herrings:&lt;BR /&gt;&lt;BR /&gt;your grep "^$USER" should end with a ":" to cater for usernames of roota, rootb, etc.&lt;BR /&gt;&lt;BR /&gt;Also, it might be worth redirecting the output of the modprpw to something other than /dev/null, and check its exit status.&lt;BR /&gt;&lt;BR /&gt;If the two operations were executed simultaneously, then some sort of lock contention may be the cause.&lt;BR /&gt;&lt;BR /&gt;Robin</description>
    <pubDate>Wed, 18 Jul 2001 14:07:28 GMT</pubDate>
    <dc:creator>Robin Wakefield</dc:creator>
    <dc:date>2001-07-18T14:07:28Z</dc:date>
    <item>
      <title>Root login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/root-login/m-p/2554275#M28536</link>
      <description>I had a funny thing happen this morning.  We have a sudo script that we can run as administrators that allows us to reactivate the passwords if a user gets locked out.  We have third party support that needs the root access and they locked root out this morning.&lt;BR /&gt;&lt;BR /&gt;I went into SAM and modified the root password just before another administrator ran the reactivate sudo script.  It locked everyone out of root.  Then i went back into SAM and modified the the root password to its original password and logged out and it worked.  The other administrators could not get into root.&lt;BR /&gt;&lt;BR /&gt;Here is the script.  Is there a gliche between the SAM modify password and the script we run?&lt;BR /&gt;&lt;BR /&gt;#-- Set up globals&lt;BR /&gt;SCRIPT=`basename $0`&lt;BR /&gt;USAGE="usage: $SCRIPT [usercode]"&lt;BR /&gt;BOLD_ON=`tput smso`&lt;BR /&gt;BOLD_OFF=`tput rmso`&lt;BR /&gt;TCBDIR="/tcb/files/auth"&lt;BR /&gt;&lt;BR /&gt;#-- Set up the FPATH environment for shell functions&lt;BR /&gt;export FPATH="/usr/local/functions:"&lt;BR /&gt;autoload FUNCTION_LIBRARY&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#-----------------------------------------------------------------------#&lt;BR /&gt;#                       O U T E R    B L O C K                          #&lt;BR /&gt;#-----------------------------------------------------------------------#&lt;BR /&gt;&lt;BR /&gt;#-- Only the superuser may activate accounts&lt;BR /&gt;if [ `id -u` != 0 ]; then&lt;BR /&gt;   print "Sorry.  You must have superuser privileges to activate an account."&lt;BR /&gt;   exit -1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;#-- Get usercode&lt;BR /&gt;USER=""&lt;BR /&gt;case "$#" in&lt;BR /&gt;   0)&lt;BR /&gt;        print "\nEnter a login name to be enabled or &lt;RETURN&gt; to exit:  \c"&lt;BR /&gt;        read USER&lt;BR /&gt;        if [ "$USER" = "" ]; then&lt;BR /&gt;           print "No user enabled."&lt;BR /&gt;           exit 0&lt;BR /&gt;        fi;;&lt;BR /&gt;   1)&lt;BR /&gt;        USER=$1;;&lt;BR /&gt;   *)&lt;BR /&gt;        print "$USAGE"&lt;BR /&gt;        exit -1;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;#-- Verify account &lt;BR /&gt;PWENTRY=""&lt;BR /&gt;PWENTRY=`grep "^$USER" /etc/passwd`&lt;BR /&gt;if [ -n "$PWENTRY" ]; then&lt;BR /&gt;   FCHAR=`echo $USER | sed "s#\(^.\).*#\1#"`&lt;BR /&gt;   if [ -r "$TCBDIR/$FCHAR/$USER" ] ; then&lt;BR /&gt;      DONE=true&lt;BR /&gt;   else&lt;BR /&gt;      print "User ($USER) was not found in password database."&lt;BR /&gt;   fi&lt;BR /&gt;else&lt;BR /&gt;   print "User ($USER) was not found in the /etc/passwd file."&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;#-- Allow operator a chance to bail out&lt;BR /&gt;print "\n\t$PWENTRY\n"&lt;BR /&gt;GET_YES_NO "Is this the entry you want to reactivate?"&lt;BR /&gt;if [ "$ANSWER" != Y ]; then&lt;BR /&gt;   print "User ($USER) was not enabled."&lt;BR /&gt;   exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;#-- Enable the account just like SAM&lt;BR /&gt;/usr/lbin/modprpw -k "$USER" 1&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;print "$BOLD_ON Account \"${USER}\" has been reactivated $BOLD_OFF"&lt;BR /&gt;&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Can someone help me on this one? It looks as if this script doesnt work even if you go into SAM before you run this and modify the root password.&lt;BR /&gt;&lt;BR /&gt;Chris&lt;BR /&gt;chrisam@rocketmail.com&lt;/RETURN&gt;</description>
      <pubDate>Wed, 18 Jul 2001 13:28:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/root-login/m-p/2554275#M28536</guid>
      <dc:creator>Vito Sarducci</dc:creator>
      <dc:date>2001-07-18T13:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Root login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/root-login/m-p/2554276#M28537</link>
      <description>Just a couple of thoughts, probably red herrings:&lt;BR /&gt;&lt;BR /&gt;your grep "^$USER" should end with a ":" to cater for usernames of roota, rootb, etc.&lt;BR /&gt;&lt;BR /&gt;Also, it might be worth redirecting the output of the modprpw to something other than /dev/null, and check its exit status.&lt;BR /&gt;&lt;BR /&gt;If the two operations were executed simultaneously, then some sort of lock contention may be the cause.&lt;BR /&gt;&lt;BR /&gt;Robin</description>
      <pubDate>Wed, 18 Jul 2001 14:07:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/root-login/m-p/2554276#M28537</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-07-18T14:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Root login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/root-login/m-p/2554277#M28538</link>
      <description>Hello Chris,&lt;BR /&gt;&lt;BR /&gt;the "-k" option of "modprpw" can only activate users&lt;BR /&gt;other than "root" - there you have to use "-x" (or it &lt;BR /&gt;is the other way round - one is working for users, the&lt;BR /&gt;other for "root", at least).&lt;BR /&gt;And insert that ":" at the end of your pattern for that&lt;BR /&gt;"grep" command!&lt;BR /&gt;HTH,&lt;BR /&gt;   Wodisch</description>
      <pubDate>Wed, 18 Jul 2001 17:27:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/root-login/m-p/2554277#M28538</guid>
      <dc:creator>Wodisch</dc:creator>
      <dc:date>2001-07-18T17:27:17Z</dc:date>
    </item>
  </channel>
</rss>

