PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > in creating script to change passwd on a number of remote hosts
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

in creating script to change passwd on a number of remote hosts

Réponse
 
LinkBack Outils de la discussion
Vieux 05/12/2006, 23h30   #1
sammy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut in creating script to change passwd on a number of remote hosts

I have a large number of remote hosts accessed using ssh.

I would like to create a script to change the root passwd on these hosts
periodically

I have tried using the following hereis file with not much luck

file:

/bin/passwd root << eof
oldpasswd
newpasswd
eof

Appreciate some advice

Sammy


  Réponse avec citation
Vieux 05/12/2006, 23h36   #2
sammy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: in creating script to change passwd on a number of remote hosts

Ps
I'm aware of yellowpages and similar applications but I would like to
automate using a shell or possible perl script.

"sammy" <kim111@bigpond.net.au> wrote in message
news:2indh.3199$HU.2704@news-server.bigpond.net.au...
>I have a large number of remote hosts accessed using ssh.
>
> I would like to create a script to change the root passwd on these hosts
> periodically
>
> I have tried using the following hereis file with not much luck
>
> file:
>
> /bin/passwd root << eof
> oldpasswd
> newpasswd
> eof
>
> Appreciate some advice
>
> Sammy
>



  Réponse avec citation
Vieux 06/12/2006, 08h07   #3
Hubble
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: in creating script to change passwd on a number of remote hosts


sammy schrieb:

> Ps
> I'm aware of yellowpages and similar applications but I would like to
> automate using a shell or possible perl script.
>
> "sammy" <kim111@bigpond.net.au> wrote in message
> news:2indh.3199$HU.2704@news-server.bigpond.net.au...
> >I have a large number of remote hosts accessed using ssh.
> >
> > I would like to create a script to change the root passwd on these hosts
> > periodically
> >
> > I have tried using the following hereis file with not much luck
> >
> > file:
> >
> > /bin/passwd root << eof
> > oldpasswd
> > newpasswd
> > eof
> >
> > Appreciate some advice
> >
> > Sammy
> >


Note that passwd wants to do some ioctl on the tty to disable echoing.
scripting tty is done by expect (you have to use TCL). Changing the
passwd is not complicated here. Look

http://www.ale.org/archive/ale/ale-2.../msg00583.html

The expect script can then be started by ssh.

Hubble.

  Réponse avec citation
Vieux 06/12/2006, 14h34   #4
Bill Marcum
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: in creating script to change passwd on a number of remote hosts

On Tue, 05 Dec 2006 23:30:06 GMT, sammy
<kim111@bigpond.net.au> wrote:
> I have a large number of remote hosts accessed using ssh.
>
> I would like to create a script to change the root passwd on these hosts
> periodically
>
> I have tried using the following hereis file with not much luck
>
> file:
>
> /bin/passwd root << eof
> oldpasswd
> newpasswd
> eof
>

For security reasons, the passwd command does not use standard input.
You need expect if you are going to use passwords and use a script to
change them. You might also consider using NIS or LDAP, or using
ssh with public and private keys instead of passwords.


--
I'll be comfortable on the couch. Famous last words.
-- Lenny Bruce
  Réponse avec citation
Vieux 09/12/2006, 02h45   #5
Carbon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: in creating script to change passwd on a number of remote hosts

On Tue, 05 Dec 2006 23:30:06 +0000, sammy wrote:

> I have a large number of remote hosts accessed using ssh.
>
> I would like to create a script to change the root passwd on these hosts
> periodically
>
> I have tried using the following hereis file with not much luck
>
> file:
>
> /bin/passwd root << eof
> oldpasswd
> newpasswd
> eof
>
> Appreciate some advice


chpasswd ought to do it.
  Réponse avec citation
Vieux 10/12/2006, 10h51   #6
Kenan Kalajdzic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: in creating script to change passwd on a number of remote hosts

sammy <kim111@bigpond.net.au> wrote:
> I have a large number of remote hosts accessed using ssh.
>
> I would like to create a script to change the root passwd on these hosts
> periodically
>
> I have tried using the following hereis file with not much luck
>
> file:
>
> /bin/passwd root << eof
> oldpasswd
> newpasswd
> eof
>
> Appreciate some advice


You might want to consider changing the hash in /etc/shadow
or an equivalent file.

--
Kenan Kalajdzic
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h17.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,14516 seconds with 14 queries