<?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: at question. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768127#M74035</link>
    <description>Hi Brian&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;We track it by a simple script in /etc/profile , which doesnt aloow anyone to login as root direclty , all SA's or authorised people login as themsleves and then su to root , this makes the system keep a su log and record who logged in and su'ed to root&lt;BR /&gt;&lt;BR /&gt;the script is as :&lt;BR /&gt;&lt;BR /&gt;loginid=`who am i | awk '{print $1}'`&lt;BR /&gt;echo $loginid&lt;BR /&gt;if [ $loginid = oracle ]&lt;BR /&gt;then&lt;BR /&gt;exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo $loginid&lt;BR /&gt;if [ $loginid = root ]&lt;BR /&gt;then&lt;BR /&gt;exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;this prevent both root and oracle to login direclty and also we get a sulog for the logging.&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava</description>
    <pubDate>Tue, 23 Jul 2002 15:44:03 GMT</pubDate>
    <dc:creator>MANOJ SRIVASTAVA</dc:creator>
    <dc:date>2002-07-23T15:44:03Z</dc:date>
    <item>
      <title>at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768113#M74021</link>
      <description>Hi Team:&lt;BR /&gt;&lt;BR /&gt;  We have an at job running on our box but we could not determine who runs it. We have a shared root program running and there are about 15 people who can login as root. Is there a way i can find the way who runs that. I tried w command but only reports if the person is logged in and since this is an "at" job we are unable to find out. Also at -l just lists the jobs. Can someone help please.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Brian.</description>
      <pubDate>Fri, 19 Jul 2002 15:04:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768113#M74021</guid>
      <dc:creator>brian_31</dc:creator>
      <dc:date>2002-07-19T15:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768114#M74022</link>
      <description>who -R&lt;BR /&gt;(IP's and terminal)&lt;BR /&gt;&lt;BR /&gt;similarly &lt;BR /&gt;&lt;BR /&gt;last -R &lt;BR /&gt;&lt;BR /&gt;to show logins (IP etc), syslog should have history of su's.&lt;BR /&gt;&lt;BR /&gt;Later,&lt;BR /&gt;Bill</description>
      <pubDate>Fri, 19 Jul 2002 15:08:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768114#M74022</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2002-07-19T15:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768115#M74023</link>
      <description>Hi Brian:&lt;BR /&gt;&lt;BR /&gt;See 'var/adm/cron/log' for a history of tasks.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 19 Jul 2002 15:10:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768115#M74023</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-07-19T15:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768116#M74024</link>
      <description>I don't think you can. Once it is launched, the process has no association to who requested it.&lt;BR /&gt;&lt;BR /&gt;You may want to not give multiple people root login, especially if you can't trust what they are doing.&lt;BR /&gt;&lt;BR /&gt;If they need root access for specific tasks, then you can install "sudo".&lt;BR /&gt;&lt;BR /&gt;Once the users have their own unique id's then you can control if they can schedule jobs, and if they are allowed, the launched jobs will have their uid assigned to the process.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Fri, 19 Jul 2002 15:12:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768116#M74024</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-07-19T15:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768117#M74025</link>
      <description>Hi Brian:&lt;BR /&gt;&lt;BR /&gt;If I understand your question, you would like to distinguish user 'root' from user 'root'. That dog won't hunt. Moreover, the person who actually submitted the at job may have logged off days ago.&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Jul 2002 15:12:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768117#M74025</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-07-19T15:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768118#M74026</link>
      <description>when you do an at -l , it shows the user =&lt;BR /&gt;field . this is the user who set the at job to run. Don't you get this ?&lt;BR /&gt;what Os are you running ?</description>
      <pubDate>Fri, 19 Jul 2002 15:21:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768118#M74026</guid>
      <dc:creator>Devbinder Singh Marway</dc:creator>
      <dc:date>2002-07-19T15:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768119#M74027</link>
      <description>Maybe you should set up pseudo root accounts (unique username with UID=0). They are easier to track. &lt;BR /&gt;&lt;BR /&gt;Another advantage of a pseudo root account is if the root account disabled, a pseudo root account can be used to enable it without having to resort to booting in single user mode.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;Marty&lt;BR /&gt;Marty</description>
      <pubDate>Fri, 19 Jul 2002 15:26:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768119#M74027</guid>
      <dc:creator>Martin Johnson</dc:creator>
      <dc:date>2002-07-19T15:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768120#M74028</link>
      <description>Pseudo root accounts (ID's with UID=0) are as bad or worse of an Idea as shared root access.&lt;BR /&gt;Why as bad?  Simple:  The system returns usernames on some commands, but only tracks and runs with UID.  Only us stupid humans use words, puters user numbers.&lt;BR /&gt;Why worse?  A bit more involved.  I have seen many applications that try to run with a username, but certain pieces use UID to get username.  Now 1/2 the process for an app run as root, the other 1/2 as the user, and for obvious reasons the applications fail.  Poor programing?  Not really, UNIX was not intended to have users equivalent to root.  If you need root you are root!&lt;BR /&gt;&lt;BR /&gt;Look at Sudo, an awsome package that logs, tracks, and controls normal ID's access to root privaleges.  Get people off of root and on their own ID, but have access to the commands they need.  At the same time, let the sys-admin keep/maintain root access because they are responsible for the system.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shannon</description>
      <pubDate>Fri, 19 Jul 2002 16:16:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768120#M74028</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2002-07-19T16:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768121#M74029</link>
      <description>It sounds like you've got some detective work to do.&lt;BR /&gt;&lt;BR /&gt;Wrap the 'at' command.  Have it send you an e-mail or log 'at' usage with the ip-address or (other information) used by the individual.  (Example below.)&lt;BR /&gt;&lt;BR /&gt;It would be helpful as well if folks were logging in as themselves and su'ing to root, rather than logging in directly.  This provides a better audit trail.  Sudo is also very, very good (&lt;A href="http://www.sudo.ws/)" target="_blank"&gt;http://www.sudo.ws/)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;1) Rename 'at' to 'at_org'.&lt;BR /&gt;&lt;BR /&gt;2) Put in place of at a shell script:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;date=`/sbin/date`&lt;BR /&gt;who=`/usr/bin/who -mTR`&lt;BR /&gt;whoami=`/usr/bin/whoami`&lt;BR /&gt;&lt;BR /&gt;echo $0 ; $date ; $who ; $whoami | /usr/bin/mailx -s at root@localhost&lt;BR /&gt;&lt;BR /&gt;/usr/bin/at_org $*</description>
      <pubDate>Mon, 22 Jul 2002 14:40:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768121#M74029</guid>
      <dc:creator>A. Daniel King_1</dc:creator>
      <dc:date>2002-07-22T14:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768122#M74030</link>
      <description>Why isn't your problem solved?&lt;BR /&gt;&lt;BR /&gt;JRF pointed you to /var/adm/cron/log, but you only gave him 4 points.&lt;BR /&gt;&lt;BR /&gt;The maximum points you gave is 7, which implies that your problem is not solved.&lt;BR /&gt;&lt;BR /&gt;Why? I.e. please describe why the information given does not solve your problem or/and give a better description of your problem.&lt;BR /&gt;&lt;BR /&gt;BTW, this is what an at(1) job looks like in /var/adm/cron/log: &lt;BR /&gt;&lt;BR /&gt;&amp;gt;  CMD: 1027427844.a&lt;BR /&gt;&amp;gt;  franks 5621 a Tue Jul 23 14:37:24 METDST 2002&lt;BR /&gt;&amp;lt;  franks 5621 a Tue Jul 23 14:37:24 METDST 2002&lt;BR /&gt;&lt;BR /&gt;".a"/"a" indicates that it is an at(1) job. 1027427844 is the job number. franks is the user. 5621 is the process ID and the dates/times are the start ("&amp;gt;") and ending ("&amp;lt;") times.</description>
      <pubDate>Tue, 23 Jul 2002 11:38:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768122#M74030</guid>
      <dc:creator>Frank Slootweg</dc:creator>
      <dc:date>2002-07-23T11:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768123#M74031</link>
      <description>Hi Team:&lt;BR /&gt;&lt;BR /&gt;  Sorry for the delay. I am not sure if danile's script would help as the job is already scheduled as root. Here is what i found in /var/adm/cron/log&lt;BR /&gt;&lt;BR /&gt;  CMD: 1027112863.a&lt;BR /&gt;  root 15314 a Fri Jul 19 17:07:43 EDT 2002&lt;BR /&gt;  CMD: 1027138073.a&lt;BR /&gt;  root 483 a Sat Jul 20 00:07:53 EDT 2002&lt;BR /&gt;&lt;BR /&gt;The PPID of the both the process is cron. With this info can i do something.Please help.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Brian.</description>
      <pubDate>Tue, 23 Jul 2002 12:51:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768123#M74031</guid>
      <dc:creator>brian_31</dc:creator>
      <dc:date>2002-07-23T12:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768124#M74032</link>
      <description>Brian,&lt;BR /&gt;&lt;BR /&gt;This is the information you currently have:&lt;BR /&gt;&lt;BR /&gt;* root specified the at job&lt;BR /&gt;* many people can login as root&lt;BR /&gt;&lt;BR /&gt;here's what you don't know:&lt;BR /&gt;&lt;BR /&gt;* when the job was specified&lt;BR /&gt;* which person was logged in as root&lt;BR /&gt;&lt;BR /&gt;Without knowing the time the job was specified you cannot hunt through the output of last or syslog to see from which host the user came from.&lt;BR /&gt;&lt;BR /&gt;Have you tried asking the people with root access whether they have set up any at jobs?&lt;BR /&gt;&lt;BR /&gt;My feeling is that you won't be able to define who ran the job.  I think you need to accept that and instead investigate the options that other users have suggested to help prevent this situation happening again.</description>
      <pubDate>Tue, 23 Jul 2002 13:18:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768124#M74032</guid>
      <dc:creator>Darren Prior</dc:creator>
      <dc:date>2002-07-23T13:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768125#M74033</link>
      <description>Hi (again) Brian:&lt;BR /&gt;&lt;BR /&gt;You can attempt to map the login place to the history in the 'var/adm/cron/log'.  Since you have the time of the event, see if you can match it to a login session:&lt;BR /&gt;&lt;BR /&gt;# last -R root&lt;BR /&gt;&lt;BR /&gt;This too, was already suggested (by Bill M.)&lt;BR /&gt;&lt;BR /&gt;Note that the addition of the '-R' option adds the hostname of the user of the session.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 23 Jul 2002 13:33:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768125#M74033</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-07-23T13:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768126#M74034</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt; Thanks All. I already tried to match it to a see with no avail. Anyway thanks a lot folks.&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards&lt;BR /&gt;Brian.</description>
      <pubDate>Tue, 23 Jul 2002 15:11:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768126#M74034</guid>
      <dc:creator>brian_31</dc:creator>
      <dc:date>2002-07-23T15:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768127#M74035</link>
      <description>Hi Brian&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;We track it by a simple script in /etc/profile , which doesnt aloow anyone to login as root direclty , all SA's or authorised people login as themsleves and then su to root , this makes the system keep a su log and record who logged in and su'ed to root&lt;BR /&gt;&lt;BR /&gt;the script is as :&lt;BR /&gt;&lt;BR /&gt;loginid=`who am i | awk '{print $1}'`&lt;BR /&gt;echo $loginid&lt;BR /&gt;if [ $loginid = oracle ]&lt;BR /&gt;then&lt;BR /&gt;exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;echo $loginid&lt;BR /&gt;if [ $loginid = root ]&lt;BR /&gt;then&lt;BR /&gt;exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;this prevent both root and oracle to login direclty and also we get a sulog for the logging.&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava</description>
      <pubDate>Tue, 23 Jul 2002 15:44:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768127#M74035</guid>
      <dc:creator>MANOJ SRIVASTAVA</dc:creator>
      <dc:date>2002-07-23T15:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768128#M74036</link>
      <description>Other people have already explained why shared root accounts and pseudo root accounts are a bad idea, and have given pointers to sudo, which is (in my opinion) the best approach.&lt;BR /&gt;&lt;BR /&gt;If you can not switch to sudo, then there *may* be another solution:&lt;BR /&gt;&lt;BR /&gt;If you are *only* interested in at(1) jobs *which have not yet finished*, i.e. are scheduled or running, you can do a "ll -rt /var/spool/cron/atjobs" to get the dates/times when the jobs were submitted. You can then match these dates/times with the information from last(1) (see for example Bill's response), and perhaps /var/adm/sulog (see su(1)), to see who did what.&lt;BR /&gt;&lt;BR /&gt;Of course that won't work if people change the dates/times of the "*.a" files, i.e. it won't work for 'hackers', but "everybody is root" doesn't work for hackers anyway, so that is a moot point.&lt;BR /&gt;&lt;BR /&gt;I hope this helps. If not, please explain why not.</description>
      <pubDate>Wed, 24 Jul 2002 12:38:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768128#M74036</guid>
      <dc:creator>Frank Slootweg</dc:creator>
      <dc:date>2002-07-24T12:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768129#M74037</link>
      <description>Again, you assigned 'only' 7 points. Does that mean that your problem is still not solved? If it is not solved, then why not, i.e. what is still missing?&lt;BR /&gt;&lt;BR /&gt;Note: You do not *have* to assign 8 or more points, for example like in this case where a poster (me) has already gotten some points and you think (s)he does not 'deserve' more points. However in that case, please *say* so, i.e. by adding an extra response, and say that the problem was solved and how. Thanks.</description>
      <pubDate>Thu, 25 Jul 2002 10:39:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768129#M74037</guid>
      <dc:creator>Frank Slootweg</dc:creator>
      <dc:date>2002-07-25T10:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768130#M74038</link>
      <description>Like Frank said, many people have pointed out options to keep you safer.  It is very hard after the fact (lots of us learn the hard way) that shared root access is not a good idea.&lt;BR /&gt;&lt;BR /&gt;Remember the old saying "An ounce of prevention is worth a pound of cure".  Wow, does this ever hold true on production servers!&lt;BR /&gt;&lt;BR /&gt;I think it mute at this point to try and figure out who ran the at job.  If the user was logged in for a time period before launching the job, and someone else logged in as root during that time then it is really not traceable.  at only tracks the user, not the accounting information for the user (I.E. logged in from, su from, etc..)&lt;BR /&gt;&lt;BR /&gt;I'd say remove root access from the users and use sudo.  More food for thought...&lt;BR /&gt;Even if you force users to su to root, if several users are su'd at the same time and one launches an at job you still can not pin it on any of the several.  The mystery remains&lt;BR /&gt;If you have to run at jobs as root, then sudo is the only way I know of to capture everything.  &lt;BR /&gt;With sudo you can create your own command so that &lt;EXAMPLE&gt; atroot runs at jobs as root.  Sudo will log and can email that "john_doe ran atroot with date/time, etc..."  Now you can see excactly who does what on the system.&lt;BR /&gt;I support more than 70 production workstations and 20 production servers.  Fat chance that anyone other than the SA in charge of a server and me have root access!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shannon&lt;/EXAMPLE&gt;</description>
      <pubDate>Thu, 25 Jul 2002 13:30:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768130#M74038</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2002-07-25T13:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: at question.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768131#M74039</link>
      <description>Thanks all of you.  Decided to go for sudo. &lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Brian.</description>
      <pubDate>Thu, 25 Jul 2002 14:41:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/at-question/m-p/2768131#M74039</guid>
      <dc:creator>brian_31</dc:creator>
      <dc:date>2002-07-25T14:41:14Z</dc:date>
    </item>
  </channel>
</rss>

