LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 08:55 PM   #1
James0806
Member
 
Registered: Jul 2014
Posts: 30

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, 09:38 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,926

Rep: Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690
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, 12:47 PM   #3
James0806
Member
 
Registered: Jul 2014
Posts: 30

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

Rep: Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690
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 12:59 PM.
 
  


Reply

Tags
script, useradd


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 10:12 AM
Allow LDAP users to change passwords graystarr Linux - Server 1 03-10-2009 06:20 PM
Allowing users to change their own passwords kaplan71 Linux - Security 3 03-08-2007 11:32 AM
Making users change passwords on first login linuxpyro Linux - Security 1 12-24-2004 02:28 PM
problem with users trying to change passwords erikm103 Linux - General 1 03-10-2003 06:10 PM


All times are GMT -5. The time now is 06:54 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration