Adam Williams
2008-Jan-24 18:06 UTC
[Samba] compare users in /etc/passwd versus /etc/samba/smbpasswd
Is there a command I can run that will compare the users in /etc/samba/smbpasswd against the users in /etc/passwd and print the ones that exist in smbpasswd but not passwd?
Kristoffer Knigga
2008-Jan-24 18:47 UTC
[Samba] compare users in /etc/passwd versus /etc/samba/smbpasswd
diff -----Original Message----- From: samba-bounces+kknigga=arrow-financial.com@lists.samba.org [mailto:samba-bounces+kknigga=arrow-financial.com@lists.samba.org] On Behalf Of Adam Williams Sent: Thursday, January 24, 2008 12:04 PM To: Samba Subject: [Samba] compare users in /etc/passwd versus /etc/samba/smbpasswd Is there a command I can run that will compare the users in /etc/samba/smbpasswd against the users in /etc/passwd and print the ones that exist in smbpasswd but not passwd? -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________
John Drescher
2008-Jan-24 18:50 UTC
[Samba] compare users in /etc/passwd versus /etc/samba/smbpasswd
On Jan 24, 2008 1:15 PM, Kristoffer Knigga <Kknigga@arrow-financial.com> wrote:> > diff >probably sort as well and maybe awk
Ryan Novosielski
2008-Jan-24 19:25 UTC
[Samba] compare users in /etc/passwd versus /etc/samba/smbpasswd
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John Drescher wrote:> On Jan 24, 2008 1:15 PM, Kristoffer Knigga <Kknigga@arrow-financial.com> wrote: >> diff >> > probably sort as well and maybe awkcut -f1 -d: to get the first field. Then sort, then diff, or a new favorite: comm . =R - -- ---- _ _ _ _ ___ _ _ _ |Y#| | | |\/| | \ |\ | | |Ryan Novosielski - Systems Programmer II |$&| |__| | | |__/ | \| _| |novosirj@umdnj.edu - 973/972.0922 (2-0922) \__/ Univ. of Med. and Dent.|IST/AST - NJMS Medical Science Bldg - C630 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHmOYcmb+gadEcsb4RAlwxAKDZMjjuURRaHss5hM4QraGP52g7fQCgg3vX Iaqio+2+Xb7afWRGSUGoe2M=I0yg -----END PGP SIGNATURE-----
Colb, Andrew
2008-Feb-27 07:07 UTC
[Samba] compare users in /etc/passwd versus /etc/samba/smbpasswd
Comm command is ideal; it was built for this type of text processing problem. It requires sorted ("collated") input lists. cut -d: -f1 /etc/passwd | sort > pass_f1 # provide sorted list of the first field in the passwd file cut -d: -f1 /etc/samba/smbpasswd | sort > smbpass_f1 # provide sorted list of the first field in the smbpasswd file then run comm. -3 pass_f1 smbpass_f1 |more this will show two columns: first is entries unique to passwd, the second column are entries unique to smbpasswd comm command has several forms based on its output in three columns: lines unique to file1, lines unique to file2 and lines found in both files. comm -1 file1 file2 displays the items that are unique to file2 [-1 says omit results unique to file1 ] comm -2 file1 file2 displays the items that are unique to file1 [-2 says omit results unique to file2] comm -3 file1 file2 displays the items that are not common to file1 and file2 comm -12 file1 file2 displays the items that are found in both file1 and file2 Andy Colb Investment Company Institute -----Original Message----- From: samba-bounces+acolb=ici.org@lists.samba.org [mailto:samba-bounces+acolb=ici.org@lists.samba.org] On Behalf Of Ryan Novosielski Sent: Thursday, January 24, 2008 2:25 PM To: John Drescher Cc: Samba Subject: Re: [Samba] compare users in /etc/passwd versus /etc/samba/smbpasswd -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John Drescher wrote:> On Jan 24, 2008 1:15 PM, Kristoffer Knigga<Kknigga@arrow-financial.com> wrote:>> diff >> > probably sort as well and maybe awkcut -f1 -d: to get the first field. Then sort, then diff, or a new favorite: comm . =R - -- ---- _ _ _ _ ___ _ _ _ |Y#| | | |\/| | \ |\ | | |Ryan Novosielski - Systems Programmer II |$&| |__| | | |__/ | \| _| |novosirj@umdnj.edu - 973/972.0922 (2-0922) \__/ Univ. of Med. and Dent.|IST/AST - NJMS Medical Science Bldg - C630 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHmOYcmb+gadEcsb4RAlwxAKDZMjjuURRaHss5hM4QraGP52g7fQCgg3vX Iaqio+2+Xb7afWRGSUGoe2M=I0yg -----END PGP SIGNATURE-----