fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] help passing a hashed password


From: Andres Riancho
Subject: Re: [Fab-user] help passing a hashed password
Date: Wed, 5 Jun 2013 17:05:23 -0300

I think this is what you need:

    pwd_hash_cmd = 'openssl passwd -1 -salt shaker "%s"' % password
    pwd_hash = run_cmd(pwd_hash_cmd).strip()

    cmd = 'useradd %s -m --password %s --gid %s --groups %s'
    run_cmd(cmd % (user, pwd_hash, user_group, extra_user_groups))

On Wed, Jun 5, 2013 at 4:42 PM, Tim Burby <address@hidden> wrote:
> Hi All,
> I am new to fabric but I'm really appreciating the power. I'm a middling sys 
> admin with sudden responsibility for about 50 servers. the Environment is 
> currently handled machine by machine for authentication. How can I pass a 
> hashed password to either useradd or usermod?
> I tried sudo("usermod -p 'wholebunchofhashstuff' jsmith") and sudo("usermod 
> -p \'wholebunchofhashstuff\' jsmith" but both have failed. and would there  
> be a way to pass the hash in from a command option? I've combed the web as 
> best as I can but pure sys admin examples are never as full as I'd like.
>
> Thanks
>
> Tim
> _______________________________________________
> Fab-user mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fab-user



-- 
Andrés Riancho
Project Leader at w3af - http://w3af.org/
Web Application Attack and Audit Framework
Twitter: @w3af
GPG: 0x93C344F3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]