[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fab-user] user is not allowed to execute '/bin/bash -l -c
From: |
Kaushal Shriyan |
Subject: |
[Fab-user] user is not allowed to execute '/bin/bash -l -c |
Date: |
Sun, 19 Jun 2011 17:52:51 +0530 |
Hi,
Please suggest/guide me about the below issue.
address@hidden:~$ cat fabfile.py
#!/usr/bin/env python
from fabric.api import *
env.shell = '/bin/bash -l -c'
env.user = 'kaushal'
env.password = 'xxxxxx'
out_log = open("output.txt", "w")
with open("hosts.txt") as host_file:
host_list = [x.strip() for x in host_file.readlines()]
@hosts(host_list)
def install():
with settings(warn_only=True):
version = sudo ("apt-get -y install bc").stderr
#version = run("klist").stderr
out_log.write("%s: %s" % (env.host, version))
address@hidden:~$ fab install
[10.30.0.163] Executing task 'install'
[10.30.0.163] sudo: apt-get -y install bc
[10.30.0.163] err: Sorry, user kaushal is not allowed to execute
'/bin/bash -l -c apt-get -y install bc' as root on
host0036.example.com.
Warning: sudo() encountered an error (return code 1) while executing
'apt-get -y install bc'
Done.
Disconnecting from 10.30.0.163... done.
address@hidden:~$
Regards,
Kaushal
- [Fab-user] user is not allowed to execute '/bin/bash -l -c,
Kaushal Shriyan <=