From: underh20 on
Hi,

We need to port our script from Solaris 10 to RedHat linux. The
script creates a list of Unix user ids that is non-root and with
password not "LK/loccked" via the command (below at end). The script
utilitzes the #passwd -as" command in Solaris where attributes of each
user is displayed (see below).

Unfortunately, "password -as" is not a valid option in RedHat linux.
Does anyone know how to tweak the command in linux to produce the
similiar output below so we can use it in our script ?

Thanks for you assistance, Bill




<Solaris 10>

# passwd -as

root PS
adm LK
daemon NL
lp NL
user1 PS 05/27/10 7 28 7
user2 PS 11/16/09 7 28


<script>
:
:
# passwd -as| grep -v LK|grep -v NL|grep -v root|cut -d" " -f1 > uLIST
From: Lew Pitcher on
On Jun 10, 2:55 pm, underh20 <underh20.scubadiv...(a)gmail.com> wrote:
> Hi,
>
> We need to port our script from Solaris 10 to RedHat linux.  The
> script creates a list of Unix user ids that is non-root and with
> password not "LK/loccked" via the command (below at end).  The script
> utilitzes the #passwd -as" command in Solaris where attributes of each
> user is displayed (see below).
>
The "passwd -aS" command reports for each password in /etc/passwd
whether the password is locked, has no password, or has a usable
password. This status is passed in the second field of each report
line, and is 'L' for "locked", 'NP' for "no password", or 'P' for "has
password".

HTH
--
Lew Pitcher
Master Codewright & JOAT-in-training | Registered Linux User #112576
Me: http://pitcher.digitalfreehold.ca/ | Just Linux: http://justlinux.ca/
---------- Slackware - Because I know what I'm doing.
------
From: Lew Pitcher on
On June 10, 2010 14:55, in comp.unix.admin, underh20.scubadiving(a)gmail.com
wrote:

> Hi,
>
> We need to port our script from Solaris 10 to RedHat linux. The
> script creates a list of Unix user ids that is non-root and with
> password not "LK/loccked" via the command (below at end). The script
> utilitzes the #passwd -as" command in Solaris where attributes of each
> user is displayed (see below).
[snip]
> # passwd -as| grep -v LK|grep -v NL|grep -v root|cut -d" " -f1 > uLIST

passwd -aS | awk '$1 != "root" && $2 != "L" { print $1}'

--
Lew Pitcher
Master Codewright & JOAT-in-training | Registered Linux User #112576
Me: http://pitcher.digitalfreehold.ca/ | Just Linux: http://justlinux.ca/
---------- Slackware - Because I know what I'm doing. ------


From: seasoned headhunter on
On Jun 11, 1:20 am, Lew Pitcher <lpitc...(a)teksavvy.com> wrote:
> On Jun 10, 2:55 pm, underh20 <underh20.scubadiv...(a)gmail.com> wrote:> Hi,
>
> > We need to port our script from Solaris 10 to RedHat linux.  The
> > script creates a list of Unix user ids that is non-root and with
> > password not "LK/loccked" via the command (below at end).  The script
> > utilitzes the #passwd -as" command in Solaris where attributes of each
> > user is displayed (see below).
>
> The "passwd -aS" command reports for each password in /etc/passwd
> whether the password is locked, has no password, or has a usable
> password. This status is passed in the second field of each report
> line, and is 'L' for "locked", 'NP' for "no password", or 'P' for "has
> password".
>
> HTH
> --
> Lew Pitcher
> Master Codewright & JOAT-in-training   | Registered Linux User #112576
> Me:http://pitcher.digitalfreehold.ca/| Just Linux:http://justlinux.ca/
> ----------      Slackware - Because I know what I'm doing.
> ------

Do any of you people live in the greater Toronto area and are
interested in a new job?
From: underh20 on
On Jun 11, 6:55 am, Lew Pitcher <lpitc...(a)teksavvy.com> wrote:
> On June 10, 2010 14:55, in comp.unix.admin, underh20.scubadiv...(a)gmail.com
> wrote:
>
>
>
> > Hi,
>
> > We need to port our script from Solaris 10 to RedHat linux.  The
> > script creates a list of Unix user ids that is non-root and with
> > password not "LK/loccked" via the command (below at end).  The script
> > utilitzes the #passwd -as" command in Solaris where attributes of each
> > user is displayed (see below).
> [snip]
> > # passwd -as| grep -v LK|grep -v NL|grep -v root|cut -d" " -f1 > uLIST
>
> passwd -aS | awk '$1 != "root" && $2 != "L" { print $1}'
>
> --
> Lew Pitcher
> Master Codewright & JOAT-in-training   | Registered Linux User #112576
> Me:http://pitcher.digitalfreehold.ca/| Just Linux:http://justlinux.ca/
> ----------      Slackware - Because I know what I'm doing.         ------

Thanks Lew for the alternative way to write the command. Since we are
porting the
script to Linux and it doesn't have "-as" option in the passwd
command.
How could we rewrite Lew's command line below to produce the same user
list output
without the "-as" command. Anyone has an idea ? thanks, Bill

passwd -aS | awk '$1 != "root" && $2 != "L" { print $1}'
 |  Next  |  Last
Pages: 1 2
Prev: sftp queries
Next: Which CPU or core to disable?