Article 57QRD Assign UID from a specific range via bash script - RHEL7

Assign UID from a specific range via bash script - RHEL7

by
r34per
from LinuxQuestions.org on (#57QRD)
Hi all,

Hoping someone can help or point me in the right direction :)

I am looking to create a bash script to create local users using the useradd' command, however I need the accounts to be given a UID only from a certain range, so let's say 1000-2000 and the UID also needs to be assigned backwards and counting down, so..

2000
1999
1998
etc..

Does anyone know a how I can achieve this?

I am running RHEL 7

Any help will be appreciated :)latest?d=yIl2AUoC8zA latest?i=8zp-d-6qaOU:dY4G3v7MeEo:F7zBnMy latest?i=8zp-d-6qaOU:dY4G3v7MeEo:V_sGLiP latest?d=qj6IDK7rITs latest?i=8zp-d-6qaOU:dY4G3v7MeEo:gIN9vFw8zp-d-6qaOU
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments