fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] user root


From: Fabien Murgues
Subject: Re: [Fab-user] user root
Date: Thu, 19 Apr 2012 09:46:47 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

Ok thX for all.
I think I will create a user with sudo capability because it simplifies all the process

On 18/04/12 17:27, Fabien Murgues wrote:
Hello,

  I want to create a script to update (aptitude update ; aptitude upgrade) Linux machines (Ubuntu and Debian).
I have succeed for the machines with a sudo account but i have a problem with accounts without sudo rights (typically on debian, a user and a root).
    With a run("su -") a password was asked and i don't know where i could put the root account/password :

My version with sudo :

from fabric.api import run,env,sudo

env.roledefs = {
    'test1' : ['address@hidden'],
    'test2' : [ 'address@hidden'],
    'all' : [ 'address@hidden', 'address@hidden'],
    }

env.passwords = {'address@hidden': 'mypwd1', 'address@hidden': 'mypwd2scd2011SCD$', 'address@hidden': 'myrootpwd'}
---------------------------------------------
                    OK if user2 has sudo
---------------------------------------------
def maj():
    sudo("aptitude update; aptitude safe-upgrade")

---------------------------------------------
                    NOT OK with root
---------------------------------------------
def maj():
    run("su -")

Thanks by advance

-- 


Cordialement, 
Fabien Murgues 

Service Commun Documentation Saint Etienne 
Informatique 
23 rue Docteur Paul Michelon 
42023 Saint Etienne Cedex 2 

tél : 04 77 48 15 92 
fax : 04 77 48 15 91


_______________________________________________
Fab-user mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fab-user

-- 


Cordialement, 
Fabien Murgues 

Service Commun Documentation Saint Etienne 
Informatique 
23 rue Docteur Paul Michelon 
42023 Saint Etienne Cedex 2 

tél : 04 77 48 15 92 
fax : 04 77 48 15 91

Attachment: fabien_murgues.vcf
Description: Vcard


reply via email to

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