Hello Team,

I have a bunch of servers where I have to login as user1 and then sudo as
super user and again change to user2 and execute a bunch of commands, can
you guys help with any thought how can I get this done in python.

I tried doing it with expect but couldnt get it right.

Steps

1. Login to host1 as user1

## ssh user1@host1
[enter password for user1]

2. use sudo and become a superuser

## sudo su
[enter password for user1]

3. change to user2

##su -l user2

## execute the commands

4. Logout

I cannot login as user2 over ssh, it is not enabled.


Regards,
Davidsanthosh L
_______________________________________________
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers

Reply via email to