SSH Kernel
Project description
SSH Kernel
SSH Kernel is a Jupyter kernel specialized in executing commands remotely with paramiko SSH client.
Major requirements
- Python3.5+
- IPython 7.0+
Installation
pip install -U sshkernel
python -m sshkernel install [--user|--sys-prefix]
# Type `python -m sshkernel install --help` for more information.
To upgrade:
pip install --upgrade sshkernel
To uninstall:
jupyter kernelspec remove ssh
pip uninstall sshkernel
Getting Started
Basic examples of using SSH Kernel.
Configuration
SSH Kernel obtains configuration data from ~/.ssh/config
file to connect servers.
Possible keywords are as follows:
- HostName
- User
- Port
- IdentityFile
- ForwardAgent
Notes about private keys
- As private key files in
~/.ssh/
are discoverable, you do not necessarily specifyIdentityFile
- If you use a ed25519 key, please generate with or convert into old PEM format
- e.g.
ssh-keygen -m PEM -t ed25519 ...
- This is because
paramiko
library doesn't support latest format "RFC4716"
- e.g.
Configuration examples
Example1:
[~/.ssh/config]
Host myserver
HostName myserver.example.com
User admin
Port 2222
IdentityFile ~/.ssh/id_rsa_myserver
ForwardAgent yes
Host *
User ubuntu
Example2:
[~/.ssh/config]
Host another-server
HostName 192.0.2.1
Minimal example:
[~/.ssh/config]
# If you specify a FQDN / IP address, same login user, and discoverable private key,
# no configuration needed
See also a tutorial above in detail.
Parameterized run
See examples/parameterized-notebook.
Limitations
- As Jupyter Notebook has limitation to handle
stdin
, you may need to change some server configuration and commands to avoid interactive input.- e.g. use publickey-authentication instead of password, enable NOPASSWD for sudo, use
expect
- e.g. use publickey-authentication instead of password, enable NOPASSWD for sudo, use
- Some shell variables are different from normal interactive shell
- e.g.
$?
,$$
- e.g.
LICENSE
This software is released under the terms of the Modified BSD License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sshkernel-0.8.1.tar.gz
(8.5 kB
view hashes)
Built Distribution
sshkernel-0.8.1-py3-none-any.whl
(10.4 kB
view hashes)
Close
Hashes for sshkernel-0.8.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a41289d816a4e51cf8b2b244230f19f047f00ed88b2aff433a5c5e1e8f0e75c |
|
MD5 | 85d441637c70d557fedd34df49603c87 |
|
BLAKE2b-256 | 1199d167ac227503a87256b120a22e18abc1717d6af49748fe70ea11a5246c16 |