Skip to content

Commit 8cb8be1

Browse files
committed
Update README.md
Added formatting and more detailed directions.
1 parent 799efc8 commit 8cb8be1

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

README.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
11
# pylogin
2-
A python utility similar to RANCID's clogin.
2+
A Python utility similar to RANCID's clogin.
33

44
I recently ran into an issue where I needed to push changes to a lot of devices that didn't have a prompt any
5-
existing utility would recognize. After finding the paramiko-expect library by fgimian, I decided to make a utility similar
6-
to clogin, but that would easily allow the user to specify different prompts to match. It does require a pythyon version
7-
of at least 2.7.
5+
existing utility would recognize. After finding the [paramiko-expect](https://github.com/fgimian/paramiko-expect) library by fgimian, I decided to make a utility similar to clogin, but that would easily allow the user to specify different prompts to match. It does require a python version of at least 2.7 due to the argparse requirement.
86

7+
### Install
8+
You will first need to verify that you have python version 2.7 installed. RHEL 6 for example still uses Python 2.6 and needs to remain that way. If you don't have version 2.7 you will need to do a local install.
9+
```
10+
[skoog@bounty pylogin]$ python -V
11+
Python 2.6.6
12+
[skoog@bounty pylogin]$ python2.7 -V
13+
Python 2.7.10
14+
[skoog@bounty pylogin]$ which python
15+
/usr/bin/python
16+
[skoog@bounty pylogin]$ which python2.7
17+
/usr/local/bin/python2.7
18+
```
19+
Next you need to install the libary dependency for the install of python being used and dowload the script.
20+
```
21+
python2.7 -m pip install git+https://github.com/fgimian/paramiko-expect.git
22+
wget https://github.com/rskoog/pylogin/blob/master/pylogin.py
23+
./pylogin.py --help
24+
```
925

10-
Usage:
26+
### Usage
1127
```
1228
[skoog@bounty pylogin]$ ./pylogin.py --help
1329
usage: pylogin.py [-h] [-c COMMAND] [-p PASSWORD] [-prompt PROMPT]
@@ -48,7 +64,7 @@ optional arguments:
4864
overrides -c
4965
```
5066

51-
Example Usage with a Sentry Commander PDU device:
67+
#### Example Usage with a Sentry Commander PDU device:
5268

5369
```
5470
[skoog@bounty pylogin]$ ./pylogin.py -c 'show syslog' -prompt 'Switched CDU: '
@@ -74,7 +90,7 @@ Switched CDU: exit
7490
Session ended
7591
```
7692

77-
Or you can just use it with a cisco router.
93+
#### Cisco Router.
7894
```
7995
[skoog@bounty pylogin]$ ./pylogin.py -c 'enable;show version' rtr
8096
Password:

0 commit comments

Comments
 (0)