[420] | 1 | #!/usr/bin/env python
|
---|
| 2 | #---------------------------------#
|
---|
| 3 | # Author: V.garonne #
|
---|
| 4 | # Mail: garonne@lal.in2p3.fr #
|
---|
| 5 | # Description: script to a ssh #
|
---|
| 6 | # proxy to connect severals hosts #
|
---|
| 7 | # i.d. a grid-like proxy #
|
---|
| 8 | #---------------------------------#
|
---|
| 9 |
|
---|
| 10 | import os, string
|
---|
| 11 | import getpass
|
---|
| 12 |
|
---|
| 13 | # my own stuffs
|
---|
| 14 | from p3 import encrypt
|
---|
| 15 |
|
---|
| 16 | #--------------------# MAIN #-------------------------#
|
---|
| 17 | if __name__ == '__main__':
|
---|
| 18 | #lx64slc4
|
---|
| 19 | pool = {
|
---|
| 20 | 'OSF1-alpha': {'machine':'asc.lal.in2p3.fr'},
|
---|
| 21 | 'Linux-i686': {'machine':'lxplus.cern.ch'},
|
---|
| 22 | #'Linux-x86_64': {'machine':'h4.lal.in2p3.fr'},
|
---|
| 23 | 'SunOS-sun4u': {'machine':'ccasn.in2p3.fr'},
|
---|
| 24 | 'AIX-002064874C00': {'machine': 'ccars01.in2p3.fr' },
|
---|
| 25 | 'Darwin-PowerMacintosh': {'machine':'wl-72137.lal.in2p3.fr'}, #mac-90109.lal.in2p3.fr
|
---|
| 26 | 'CYGWIN_NT-5.1-i686' : {'machine':'134.158.72.234'},
|
---|
| 27 | 'VisualC' : {'machine':'134.158.72.234'},
|
---|
| 28 | 'Linux-x86_64': {'machine':'lxcert-amd64.cern.ch'},
|
---|
| 29 | 'Linux-ia64' : {'machine':'lxcert-ia64.cern.ch'}
|
---|
| 30 | }
|
---|
| 31 | #134.158.72.234
|
---|
| 32 | #134.158.72.234
|
---|
| 33 | preambule = 'cmt_create_proxy > '
|
---|
| 34 | print preambule + "Do the configuration acces of the remote machines"
|
---|
| 35 | for platform in pool:
|
---|
| 36 | print preambule + 'Enter the parameters for machine ' + pool[platform]['machine']
|
---|
| 37 | user = raw_input (preambule + ' user: ')
|
---|
| 38 | password = getpass.getpass(preambule + user+'@'+ pool[platform]['machine'] + "'s password: ")
|
---|
| 39 | pool[platform]['user'] = user
|
---|
| 40 | pool[platform]['pwd'] = password
|
---|
| 41 |
|
---|
| 42 | f = open('.cmtproxy', 'w+')
|
---|
| 43 | f.write (encrypt(str(pool)))
|
---|
| 44 | f.close()
|
---|
| 45 | #----------------------- End Of File --------------------------#
|
---|