python


SSH to a server and exit Python script (in the same shell)


I'm running a script that's determining login information for me, and in the end is outputting the login information that I need to use.
I am running the script in a terminal, and now I want it to SSH me with the credentials it has, exit the Python script on my computer and connect my current terminal to the new server.
Say I already have my sshHost, sshUser and sshPass as variables in the script. How do I run an SSH command in the current terminal and connect to that server?
I tried subprocess and spur, however I didn't really manage to get that going.
I would really appreciate your help and thanks in advance.
assuming the python prints the settings to stdout;
#!/bin/sh
export $(credentials.py)
exec ssh hostname

Related Links

OSError when trying to delete keys from redis
remove/reset matplotlib quiver arrows
Repeating elements in a list
Run python-rq worker process on application start
Chrome Not Starting When Using ChromeDriver
How to selectively iterate over files with Python
I'm having trouble using docker-py in a development environment on OSX
How to query AWS to get ELB names and attached instances to that using python boto modules?
Pi Wireless AP is dropping shortly after boot
How to redirect python logging output to file instead of stdout?
Matplotlib- Any way to use integers AND decimals in colorbar ticks?
ImportError: No module named setuptools.command on Mac OS X within virtualenv
Numpy Minimize COBYLA Constraints
Pyside Installation “Failed to find the MSVC compiler version 10.0 on your system”
How to do a group by operation on a list of json objects in python?
How to pass enum as argument in ctypes python?

Categories

HOME
ssas-2012
sass
mql4
meshlab
textwatcher
d
parse-server
tomcat7
value
gspread
simpy
spring-cloud-contract
eclipse-cdt
packer
metronic
criteria
jboss-eap-7
wordpress-theming
image-recognition
webmethods
jacoco
spring-cloud-config
phpbb
ada
zend-framework-mvc
zoho
device-detection
sonarqube-msbuild-runner
piwik
xilinx-ise
mangodb
red-black-tree
android-vpn-service
outsystems
receipt
npm-publish
sql-like
google-account
android-maps-v2
finite-element-analysis
worker
filepath
aqgridview
walmart-electrode
text-classification
tcserver
instruction-set
quintus
opencpu
communication-protocol
createobject
sqldatareader
picasa
brackets-shell
test-class
android-viewholder
jta
windows-vista
callstack
shift-jis
alphablending
microblaze
qtestlib
fragment-tab-host
snmp4j
neoload
cppdepend
zipalign
bfd
layered
installshield-2009
jqmobi
fieldset
zend-framework-modules
pys60
osi
driving-directions
jquery-selectbox
printing-web-page
msbuildextensionpack
for-xml-path
mvccontrib-grid
j-interop
file-encodings
delegatecommand
mvvm-foundation
usability-testing
usergroups
document-library

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App