Python scripts I use to manage my ssh connections, drive mounts, and other bash related things.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

177 lines
5.0 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. # Roosay
  2. ```
  3. -------------
  4. < Only at RIT >
  5. -------------
  6. \ /)/)
  7. \ (ø.ø)
  8. \ ( />
  9. __/ _\ //
  10. '~( '~ )//
  11. _\ '}/
  12. "--~(/
  13. ```
  14. roosay is a simple python script which displays an ascii roo with a quote above it
  15. ## Usage
  16. ```
  17. python3 roosay.py Super cool message
  18. ```
  19. or create a .bashrc alias
  20. ```
  21. roosay super cool message
  22. ```
  23. # Install
  24. ```
  25. git clone https://github.com/jrtechs/bash_manager.git
  26. ```
  27. # Dependencies
  28. Make sure that you have the following programs installed.
  29. - python3
  30. - ssh
  31. - ssh-copy-id
  32. - sshfs (only for ssh drive manager)
  33. - fusermount (only for ssh drive manager)
  34. # SSH Manager
  35. ```
  36. **************************************
  37. * SSH manager V 1.1 *
  38. * 1) user1@host_name *
  39. * 2) user2@host_name_2 *
  40. * A) Exit *
  41. * B) Manager tools *
  42. * C) Socks Tunnel *
  43. * D) SSH Drive Manager *
  44. **************************************
  45. ```
  46. ## About
  47. I developed this program to simply make it easier to manager all your ssh accounts
  48. in a single program. SSH keys are nice; however, you still have type "ssh user1@host"
  49. every time you wish to connect to a computer -- which can be a lot for some people.
  50. This program keeps track of all your ssh accounts so they are a few keystrokes away.
  51. ## Installation
  52. This program is simply a python script that you execute.
  53. ```
  54. python3 ssh_manager.py
  55. ```
  56. You can edit your bash configuration with an alias to make it easier to execute.
  57. ```
  58. alias ss="python3 /path/to/this/file/ssh_manager.py"
  59. ```
  60. To make this easier, the confuguation manager of this program will has the option to
  61. append this and a few other aliases to your bash manager. This will autobatically
  62. use the location of the scripts in the file.
  63. The first time you run this program it will ask you for the locations where you want to store
  64. some files which will be used to store the host names and user accounts. The default is to put
  65. it in the same directory as the source code.
  66. ## Usage
  67. After you accept the configuration you will see something like this.
  68. ````
  69. **************************************
  70. * SSH manager V 1.1 *
  71. * A) Exit *
  72. * B) Manager tools *
  73. * C) Socks Tunnel *
  74. * D) SSH Drive Manager *
  75. **************************************
  76. **************************************
  77. ````
  78. I would like to believe that I made this menu intuitive enough so you don't have to
  79. read any documentation. However...
  80. Typing B will pull up this menu:
  81. ````
  82. **************************************
  83. * Options *
  84. * 1) Add Host *
  85. * 2) Copy SSH key to server *
  86. * 3) Remove host name *
  87. * 4) Return to ssh manager *
  88. * 5) Manage Configuration and Bash *
  89. * 6) Exit *
  90. **************************************
  91. Enter selection:
  92. ````
  93. This is where you can run the add host names to the manager -- same as adding them to
  94. the "servers.txt".
  95. If you don't have ssh keys installed on your servers, or forgot the command to do so,
  96. you can use the "2" option to copy your ssh key to a server.
  97. "3" Pulls up an additional menu which you can use to select a entry to remove.
  98. "4" Returns to the main manager window.
  99. "5" Edits the configuration which stores where this program keeps text documents
  100. for the hosts used.
  101. If you added some accounts your main window should look like this:
  102. ````
  103. **************************************
  104. * SSH manager V 1.1 *
  105. * 1) user1@host_name *
  106. * 2) user2@host_name_2 *
  107. * A) Exit *
  108. * B) Manager tools *
  109. * C) Socks Tunnel *
  110. * D) SSH Drive Manager *
  111. **************************************
  112. ````
  113. Now is the easy part. Simply enter the number of the computer you wish to connect to
  114. and it will open a ssh connection.
  115. If you are interested in doing lots of socks proxies -- for whatever reason.
  116. From the main menu type "C".
  117. ````
  118. **************************************
  119. * Socks Tunnel *
  120. * 1) user1@host_name *
  121. * 2) user2@host_name_2 *
  122. * A) Exit *
  123. * B) Main *
  124. **************************************
  125. ````
  126. Now whichever computer you select, it will open a socks proxy. To use the proxy use
  127. localhost and port 8123.
  128. # SSH Drive Mount Manager
  129. This manager makes it easier to mount ssh drives using the "fusermount" command.
  130. ```
  131. **************************************
  132. * SSH Drive Manager *
  133. * 1) Mount SSH Drives *
  134. * 2) Un-Mount SSH Drives *
  135. * 3) Remove Remote Drive *
  136. * 4) Add Drive to Mount *
  137. * 5) View Drives *
  138. * 6) Usage *
  139. * 7) Manage Config *
  140. * 8) Exit *
  141. **************************************
  142. ```