Hello;<div><br></div><div>About finding root-entries in /etc/passwd;<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">catch the toor.<br>


<br>
I suggest<br>
       grep ':0:[0-9]*:' test-pass  | grep -v '^root:'<br></blockquote><div><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">The 'grep' implementation of the check is wrong/too simple.</div>

<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Of course, one could argue that </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<font face="courier new, monospace">    awk -F: '$3==0 { print $0 }' /etc/passwd</font></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">is much better BUT:</div>

<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">- lines can be commented out (bad idea but people do it)</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

- /etc/passwd could be additional to LDAP sources etc etc. I have seen systems where 5% is in /etc/passwd and the rest in OpenLDAP or even ActiveDirectory!!!</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">In anyway, it is a bad thing trying to parse the /etc files 'manually'. You need an operating-system dependent non-do-it-yourself way of getting the list of configured users, *then* scan for user0. I'd say; "man getpwuid" -- no make that getpwent.</div>

<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">

Regards,</div><div><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">Klaas</span> </div></div></div>