LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-18-2014, 07:55 PM   #1
James0806
Member
 
Registered: Jul 2014
Posts: 41

Rep: Reputation: Disabled
Want to create 25 Users and forcing the users to change passwords


for i in 1 2 3 4 5; do useradd user$i; echo user$i | passwd --stdin user$i; done



I found this while googling i just want to create some users and allowing them to change their passwords after their first login using script
 
Old 10-18-2014, 08:38 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by James0806 View Post
for i in 1 2 3 4 5; do useradd user$i; echo user$i | passwd --stdin user$i; done

I found this while googling i just want to create some users and allowing them to change their passwords after their first login using script
Ok...and your question/problem is what? Or is this another homework question?

Read the man page on the useradd command, read up on how to set a default on password expiration, and (again) read one of the MANY bash scripting tutorials.
 
Old 10-19-2014, 11:47 AM   #3
James0806
Member
 
Registered: Jul 2014
Posts: 41

Original Poster
Rep: Reputation: Disabled
Not the answer i was expecting
 
Old 10-19-2014, 11:56 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by James0806 View Post
Not the answer i was expecting
If you were expecting a handout, then no. If you wanted guidance and advice/hints on how to solve the problem ON YOUR OWN, you got it. Show effort of your own, and perhaps explain what you're confused about, and you'll get help. Posting a snippet of a script and telling people what you expect isn't doing that.

You have the tools to do what you're after; whether you actually USE those tools or not isn't something we can help you with. Look at your other threads, where you ask homework questions:
http://www.linuxquestions.org/questi...ud-4175515055/
http://www.linuxquestions.org/questi...rs-4175515947/
http://www.linuxquestions.org/questi...on-4175510578/
http://www.linuxquestions.org/questi...ge-4175513826/
http://www.linuxquestions.org/questi...th-4175512351/

Last edited by TB0ne; 10-19-2014 at 11:59 AM.
 
  


Reply

Tags
script, useradd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Forcing Users for strong passwords sushantchawla2005 Linux - Server 5 08-21-2009 09:12 AM
Allow LDAP users to change passwords graystarr Linux - Server 1 03-10-2009 05:20 PM
Allowing users to change their own passwords kaplan71 Linux - Security 3 03-08-2007 10:32 AM
Making users change passwords on first login linuxpyro Linux - Security 1 12-24-2004 01:28 PM
problem with users trying to change passwords erikm103 Linux - General 1 03-10-2003 05:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration