[opensuse] how to add users non interactively?
Hi, is there a convenient way to add a couple of user accounts in a non interactive way? I'd like to have a scrpipt that does something like useradd user1 --p pass1 -G group1, group2 useradd user2 --p pass2 -G group2, group3 ... I'd rather have those passwords unencrypted in the batch file as I can make sure noone will see it. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sat, Mar 24, 2012 at 01:20:07AM +0100, Andreas wrote:
Hi, is there a convenient way to add a couple of user accounts in a non interactive way?
I'd like to have a scrpipt that does something like
useradd user1 --p pass1 -G group1, group2 useradd user2 --p pass2 -G group2, group3 ...
I'd rather have those passwords unencrypted in the batch file as I can make sure noone will see it.
Pretty much like you write. useradd -G group1,group2 -p pass1 user1 useradd -G group2,group3 -p pass2 user2 etc. see man useradd Ciao, Marcus -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andreas
Hi, is there a convenient way to add a couple of user accounts in a non interactive way?
I'd like to have a scrpipt that does something like
useradd user1 --p pass1 -G group1, group2 useradd user2 --p pass2 -G group2, group3 ...
I'd rather have those passwords unencrypted in the batch file as I can make sure noone will see it. --
There must be a way to protect a password in a script, but I don't know it. Can the script be interactive with the user and ask for the passwords? Or have the passwords in an encrypted container and ask the user for the password needed to extract the user passwords? Anyway, I suggest you repost the question with a subject about protecting passwords when working with scripts. It's a generic question that has nothing to do with adding users. Greg -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-03-24 11:39, Greg Freemyer wrote:
I'd rather have those passwords unencrypted in the batch file as I can
make sure noone will see it.
There must be a way to protect a password in a script, but I don't know it.
I don't read his post as asking how to protect the password. He says "unencrypted", he wants them unencrypted because as nobody is going to read the script there is no problem with that. - -- Cheers / Saludos, Carlos E. R. (from 11.4 x86_64 "Celadon" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk9t92gACgkQIvFNjefEBxpT3ACgzwJ4JLUchpRwVk0zrMjzXXoK 03kAnAyZDNGAiRRgw0XROTZ4EPpdhXAy =0vF2 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Sat, 24 Mar 2012, Carlos E. R. wrote:
On 2012-03-24 11:39, Greg Freemyer wrote:
I'd rather have those passwords unencrypted in the batch file as I can
make sure noone will see it.
There must be a way to protect a password in a script, but I don't know it.
I don't read his post as asking how to protect the password. He says "unencrypted", he wants them unencrypted because as nobody is going to read the script there is no problem with that.
$ /usr/sbin/useradd --help [..] -p password Encrypted password as returned by crypt(3) [..] See also 'man mkpasswd'. HTH, -dnh -- Ich frage mich, ob es einen richtigen Browser als Active-X Applet für den MSIE gibt? -- K. Köhntopp -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Am Samstag, 24. März 2012, 01:20:07 schrieb Andreas:
Hi, is there a convenient way to add a couple of user accounts in a non interactive way?
I'd like to have a scrpipt that does something like
useradd user1 --p pass1 -G group1, group2 useradd user2 --p pass2 -G group2, group3 ...
I'd rather have those passwords unencrypted in the batch file as I can make sure noone will see it.
Hi Andreas, try "chpasswd". It even works with encrypted passwords. Regards, Martin -- I would rather be exposed to the inconveniences attending too much liberty, than those attending too small a degree of it. -- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (6)
-
Andreas
-
Carlos E. R.
-
David Haller
-
Greg Freemyer
-
Marcus Meissner
-
Martin Jedamzik