一个实用程序,用于实现到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帐户中的以下实例:

  • 挤压计算-198.51.100.13
  • 展平腹板-198.51.100.14
  • 挤压数据-198.51.100.15

假设我将我的压缩相关代码保存在~/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 `

砰。

##注释

  • aws-ssh试图通过测试 用户名。现在,用户名序列是固定的(并且基于 通用AMI用户名)。在将来的版本中,这将是可配置的。
  • 如果您的访问依赖于自定义路由(例如,在惰性vpn后面),则 可能需要中止连接尝试(通过^c)并手动添加路由 例如。

##贡献

欢迎投稿!一定要使用开发包,在devextra下提供。

`console $ git clone git@github.com:arusahni/aws-ssh $ cd aws-ssh $ pip install -e .[dev] `

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java同时读取输入流   安卓中的java短信监听   java你能帮我弄清楚如何在我的测验程序中组织数据吗?   列表中的java对   Java中的异常重复   通过SSH | Netbeans进行java远程调试   JAVAutil。扫描程序Java扫描程序在循环后读取整数失败?   用于温度转换器的构造函数java基本访问器方法   java如何将地图封装到自定义对象中   java更改布局不透明度,Progressbar除外   在REST中将java对象转换为XML时出错   java Spring引导IllegalArgumentException:找不到类[org.hibernate.cfg.ImprovedNamingStrategy]]   java Spring REST API,响应中的自定义实体字段   java数据库将null返回给布尔变量   mysql如何在java中将“'”转换为“`”