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

Matplotlib and non-ascii characters
How does HttpResponse(status=<code>) work in django?
Write a CSV from Urlib and manage encoding properly
python - list index out of range, working with CSV?
Pandas DataFrame get substrings from column
Python GET is not working in browser
Django, Pinax, couldn't extract file
Getting proper list of members from pymongo
Not writing into an Excel file
How to integrate my python plugin with nagios
Find words containing . in middle or at the end
Using apply on a column
Maximum-sum subarray given constraints on indices
Converting text to columns
easily make labels look nice pandas plotting
checking if a file exists with a variable on python

Categories

HOME
pug
mapbox-gl-js
search-engine
jscript
requirejs
diagram
facebook-javascript-sdk
eclipse-cdt
uiactivityviewcontroller
cartodb
nixos
wordpress-theming
wysiwyg
spinnaker
x-frame-options
medium-editor
zope
yeoman-generator
eclipselink
cython
flexboxgrid
kitematic
facebook4j
onesignal
weinre
pygooglechart
gpib
piecewise
helix-3d-toolkit
canvasjs
shapes
pycparser
superpowered
service-locator
powershell-remoting
rider
duktape
rule
ddms
powermta
3scale
rdw
range-v3
chunked-encoding
gist
broadcast
spell-checking
shutdown
slidesjs
quintus
infinite-scroll
communication-protocol
master
radians
nofollow
gherkin
image-editing
uwp-maps
fps
post-processing
android-recyclerview
loose-typing
direct3d12
datasnap
python-winshell
connection-reset
type-mismatch
divide-by-zero
candidate-key
fragment-tab-host
alpha-transparency
neoload
kraken.js
help-viewer
broadcasting
crystal-reports-10
dynamic-proxy
sanitization
sqljdbc
cling
sslexception
dllexport
multiple-login
dig
nuspec
mstsc
cgimageref
dwolla
xml-libxml
wpdb
transitive-closure-table
returnurl
macruby
expression-evaluation
throttling
port-scanning
surefire
code-design
web-statistics
dirty-data

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