一个实用程序,用于实现到aws ec2实例的简单ssh连接。
aws-ssh的Python项目详细描述
#AWS-ssh
[![生成状态](https://travis-ci.org/arusahni/aws-ssh.svg?branch=master)](https://travis-ci.org/arusahni/aws-ssh) [![覆盖状态](https://coveralls.io/repos/github/arusahni/aws-ssh/badge.svg?branch=master)](https://coveralls.io/github/arusahni/aws-ssh?分支=主)
按名称ssh到项目特定的aws ec2实例中,而不必 记住IP地址和私钥,或者管理ssh配置。
打开这个:ssh-i~/.ssh/project-key.pem ubuntu@198.51.100.13
其中:aws ssh compute ##入门 ###先决条件 aws-ssh在posix系统上需要python 2.7或更高版本。你还需要
安装并配置了[aws cli](https://aws.amazon.com/cli/)。 ###安装 建议使用pip方法: `console
$ pip install aws-ssh
` 我建议将其安装到virtualenv中,然后对二进制文件进行符号链接
去你的路。例如: `console
$ mkvirtualenv -p $(which python3) aws-ssh # Python 3 recommended
$ pip install aws-ssh
# Assuming ~/bin/ is in your $PATH...
$ ln -s~/.virtualenvs/aws-ssh/bin/{aws-ssh,awssh,ssh-ec2,aws-ssh-cli} ~/bin/
$ deactivate
` 现在您应该可以在virtualenv之外使用aws-ssh了! ###用法 安装后,您需要创建一个项目。项目是ec2的集合
共享一组公共参数的实例。例如,我可能在工作
在squanch项目中,使用aws帐户中的以下实例: 假设我将我的压缩相关代码保存在~/code/squanch中,我将首先
需要在该目录中初始化aws-ssh项目: `console
$ cd ~/code/squanch
$ aws-ssh--init
Please provide the full path ot the directory containing all private keys: ~/.ssh/
Please provide a name for this project: squanch
Please provide the AWS profile to use: default
Please provide the name of the private key used for authentication (including extension): squanch.pem
Please provide the prefix for EC2 names: squanch-
Please provide the root directory for the project: ~/code/squanch
` 这将在项目根目录中创建一个.awssshconfig文件。你
可以在版本控制下对其进行管理,以使团队位于同一页:—) 现在aws-ssh已经配置好了,是时候连接到一个实例了! `console
$ cd ~/code/squanch
$ aws-ssh web
# Successful SSH connection to 198.51.100.14
` 砰。 ##注释 ##贡献 欢迎投稿!一定要使用开发包,在devextra下提供。 `console
$ git clone git@github.com:arusahni/aws-ssh
$ cd aws-ssh
$ pip install -e .[dev]
`推荐PyPI第三方库