Go Back   Aquarium Advice - Aquarium Forum Community > Community Forum > Aquaria Off-Topic
Click Here to Login

Join Aquarium Advice Today
Closed Thread
 
Thread Tools Search this Thread Display Modes
Please support our sponsors and let them know you heard about them on AquariumAdvice.com
 
Old 05-18-2005, 12:23 PM   #11
Aquarium Advice Activist
 
Join Date: May 2004
Location: North Carolina
Posts: 126
Quote:
Originally Posted by deli_conker
I take it that done == next (as in old school basic next)?
Yeah - I guess "rof" didn't look cool enough.

Try 'help if' and 'help for' in bash to get an explanation of those commands ('info bash' if you've got a few hours to kill). 'man test' or 'info test' will explain the many functions it can do.
__________________

__________________
Maybe didn't mean so much, but it meant everything to me. - T. Reznor
SteveM is offline  
Old 05-18-2005, 12:32 PM   #12
Aquarium Advice Addict
 
Join Date: Dec 2003
Location: Central Ohio
Posts: 1,728
Send a message via Yahoo to deli_conker
Thanks for the info. I just finished reading a short article about basename. It all makes sense. Thanks.

Now for part 2...

I need to set the passwords for all of these accounts as well. I am going to set a default password for each using...
Code:
passwd -e <username>
This will make it so that they will have to change their password after the first login. Can I use the same method in the cp script to expidite this? I am assuming that I can, but for some reason my boss didn't know how to do it (although in his defense, he was heading out to the Outer Banks for a week when he told me this).

I suppose I can always make an alias for "rof"...
__________________

__________________
deli_conker is offline  
Old 05-18-2005, 01:44 PM   #13
Aquarium Advice Activist
 
Join Date: May 2004
Location: North Carolina
Posts: 126
That's probably a reasonable way to execute a command for each username.

Code:
for i in /home/* ; do echo passwd -e `basename $i` ;done
hmmm - when I do passwd -e to an account on my debian system I can't log in at all (using ssh). You might want to test its effect on your system before you hit all the user accoounts with it

"rof" alias is a neat idea - make one for "elihw" and "litnu" too Actually done terminates any command with a "do", so there are a few others I think.
__________________
Maybe didn't mean so much, but it meant everything to me. - T. Reznor
SteveM is offline  
Old 05-18-2005, 01:55 PM   #14
Aquarium Advice Addict
 
Join Date: Dec 2003
Location: Central Ohio
Posts: 1,728
Send a message via Yahoo to deli_conker
When I do the "passwd" command with the username after it, it asks me to type in the new password followed by a confirmation consisting of re-typing the new password.

I don't think the above code will work. Then again, I might just have to typeand retype the default password 100 or so times...
__________________
deli_conker is offline  
Old 05-19-2005, 04:13 AM   #15
AA Team Emeritus
 
czcz's Avatar
 
Join Date: Nov 2004
Location: US
Posts: 2,821
You have to enter password with passwd -e on Suse? You might want to try
Code:
for i in /home/*; do echo passwd -e $(basename "$i"); done
Hey Steve, does the user you're testing with ssh have shell access? Just a thought.
__________________
"2- before attempting to plant, have a beer or a Bourbon. That will help to steady your hands…" -- elwaine

wet.biggiantnerds.com
czcz is offline  
Old 05-19-2005, 08:35 AM   #16
Aquarium Advice Addict
 
Join Date: Dec 2003
Location: Central Ohio
Posts: 1,728
Send a message via Yahoo to deli_conker
Quote:
Originally Posted by czcz
You have to enter password with passwd -e on Suse? You might want to try
Code:
for i in /home/*; do echo passwd -e $(basename "$i"); done
I still have to type and re-type the password for each user in the above example. Is there any way around that?
__________________
deli_conker is offline  
Old 05-19-2005, 09:43 AM   #17
AA Team Emeritus
 
czcz's Avatar
 
Join Date: Nov 2004
Location: US
Posts: 2,821
I just read this thread again. What else is on your to do list? I ask because you could have had /etc/skel/.* in each user's home, set same password, and -e flagged with one command: adduser. Try man adduser and see if it has other things you need -- consider starting users from scratch (seriously, maybe faster depending on whats been and needs to be done).
__________________
"2- before attempting to plant, have a beer or a Bourbon. That will help to steady your hands…" -- elwaine

wet.biggiantnerds.com
czcz is offline  
Old 05-19-2005, 01:50 PM   #18
Aquarium Advice Addict
 
Join Date: Dec 2003
Location: Central Ohio
Posts: 1,728
Send a message via Yahoo to deli_conker
I had nothing to do with this part of the project (until my boss went on vacation). As far as users are concerned, I only have to copy the .* from /etc/skel to the already made users /home directories and give them a password (which is the same for all users).
__________________
deli_conker is offline  
Old 05-19-2005, 02:22 PM   #19
Aquarium Advice Addict
 
Join Date: Dec 2003
Location: Central Ohio
Posts: 1,728
Send a message via Yahoo to deli_conker
Ok. I tried the script with the echoes in it. The cp works great, but the chown does not. The 'basename' part does not work correctly. The version I am using either does not support this natively or we do not have the necessary software to interpret this correctly.

I may just go ahead and type in all the user names and then copy and paste all other pertinent information in front of them (for chown and passwd). Not exactly time saving, but it has to be done soon...
__________________
deli_conker is offline  
Old 05-19-2005, 05:59 PM   #20
AA Team Emeritus
 
czcz's Avatar
 
Join Date: Nov 2004
Location: US
Posts: 2,821
Its not pretty (there's better ways to do this), but follows format repeated previously.
Code:
for i in /home/*; do echo usermod -p $(echo yourpass | openssl passwd -1 -stdin) $(basename "$i"); echo chown $(basename "$i") $i/.*; done
This pipes "yourpass" through openssl because its easy and usermod only likes encrypted passwords -- you need this echo when executing. Note basename syntax (which is also in code in previous post) or just man. So, if this is what you want, you would run
Code:
for i in /home/*; do usermod -p $(echo yourpass | openssl passwd -1 -stdin) $(basename "$i"); chown $(basename "$i") $i/.*; done
__________________

__________________
"2- before attempting to plant, have a beer or a Bourbon. That will help to steady your hands…" -- elwaine

wet.biggiantnerds.com
czcz is offline  
Closed Thread

Tags
ick

Please support our sponsors and let them know you heard about them on AquariumAdvice.com

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick Question DeadOrAlive Saltwater Fish Only & FOWLR 2 12-16-2009 04:07 PM
quick question mike3epanda Saltwater Fish Only & FOWLR 2 07-28-2007 08:47 AM
Quick question... ntswift Saltwater Reef Aquaria 15 03-25-2006 01:36 AM
Quick question fishman Saltwater Reef Aquaria 4 08-05-2004 10:21 AM







» Photo Contest Winners








Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -4. The time now is 06:37 PM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.