aws windows linux同时,AWS EC2笔记之一 如何通过Putty连接AWS Linux系统_大风歌幻觉的博客-程序员宝宝

技术标签: aws windows linux同时  

Connecting to Linux/UNIX Instances from Windows Using PuTTY

To connect to your Linux/UNIX instance from a Windows computer, use

an SSH client. The following instructions explain how to use PuTTY,

a free SSH client for Windows computers.

Prerequisites

Enable SSH traffic—Open the instance's

SSH port

Before you try to connect, ensure that your Amazon EC2 instance

accepts incoming SSH traffic (usually on port 22). For more

information, see

Instance ID—Get the ID of your Amazon

EC2 instance

Retrieve the Instance ID of the Amazon EC2 instance you want to

access. The Instance ID for all your instances are available in the

AWS Management Console or through the CLI

command

Instance's public DNS—Get the public

DNS of your Amazon EC2 instance

Retrieve the public DNS of the Amazon EC2 instance you want to

access. You can find the public DNS for your instance using the AWS

Management Console or by calling the CLI

command ec2-describe-instances.

The format of an instance's public DNS is

ec2-w-x-y-z-compute-1.amazonaws.com where w, x, y, and z each

represents a number between 0 and 255 inclusive.

Private key—Get the path to your

private key

You'll need the fully qualified path of the private key file

associated with your instance. For more information on key pairs,

see

Getting

PuTTY

To download and

install PuTTY

Other tools in the PuTTY suite are

PuTTYgen, a key generation program, and pscp, a secure copy command

line tool. The different PuTTY tools are separate applications. You

can install them separately or install the entire suite with a

simple Windows installer. The following instructions assume you've

installed the entire suite and can access all the components from

the Windows Start menu.

Converting

Your Private Key

PuTTY does not natively support the

private key format generated by Amazon EC2. Fortunately, PuTTY has

a tool called PuTTYgen, which can convert keys to the required

PuTTY format.

To convert your

private key

Start PuTTYgen (for example, from

the Start menu,

click All Programs > PuTTY >

PuTTYgen).

Click Load and browse to the

location of the private key file that you want to convert

(e.g., GSG_Keypair.pem).

By default, PuTTYgen displays only files with

extension .ppk; you'll

need to change that to display files of all types in order to see

your .pem key

file. The private key file must end with a newline character or

PuTTYgen cannot load it correctly.

a4c26d1e5885305701be709a3d33442f.png

Select

your .pem key

file and click Open.

PuTTYgen displays the following

message.

a4c26d1e5885305701be709a3d33442f.png

When you click OK, PuTTYgen displays

a dialog box with information about the key you loaded, such as the

public key and the fingerprint. The keys that Amazon EC2 generates

are 1024-bit SSH-2 RSA keys.

Click Save private

key to save the key in PuTTY's format.

PuTTYgen asks if you want to save the key without a passphrase.

a4c26d1e5885305701be709a3d33442f.png

Click Yes.

Note

A passphrase

on a private key is an extra layer of protection, so even if your

private key is discovered, it will not be usable without the

passphrase. The downside to using a passphrase is that it makes

automation harder because human intervention is needed to log on to

an instance, or copy files to an instance. For this exercise, we're

not using a passphrase.

Use the same name for the key that

you used for the key pair (for example, GSG_Keypair). PuTTY

automatically adds the .ppk file

extension.

Your private key is now in the

correct format for use with PuTTY. You can now connect to your

instance using PuTTY's SSH client.

Connecting

Using PuTTY SSH

You'll connect by starting a PuTTY

SSH session.

To use SSH to

connect

If you've launched a public AMI that

isn't one that you created yourself, run

the ec2-get-console-output command

on your local system (not on the instance), and locate

the SSH HOST KEY

FINGERPRINTS section. For more information,

see ec2-get-console-output in

the Amazon Elastic Compute

Cloud Command Line Reference.

C:\>ec2-get-console-output instance_id

...

ec2: -----BEGIN SSH HOST KEY FINGERPRINTS-----

ec2: 2048 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

/etc/ssh/ssh_host_key.pub

ec2: 2048 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

/etc/ssh/ssh_host_rsa_key.pub

ec2: 1024 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

/etc/ssh/ssh_host_dsa_key.pub

ec2: -----END SSH HOST KEY FINGERPRINTS-----

...

Note the fingerprints so that you

can compare them to the fingerprints of the instance.

Start PuTTY (from

the Start menu,

click All Programs > PuTTY >

PuTTY).

A dialog box opens with a Category menu on

the left side. On the right side, the basic options for your PuTTY

session are displayed.

In the Host

Name field, enter the public DNS name of

your instance (available through the AWS Management Console or

the ec2-describe-instancescommand).

You can optionally prefix the DNS name

with [email protected] to

automatically log in with superuser privileges when the session

opens.

a4c26d1e5885305701be709a3d33442f.png

In the Category menu,

under Connection,

click SSH, and

then Auth.

The options controlling SSH authentication are displayed.

Click Browse and navigate to

the PuTTY private key file you generated in the preceding

section.

a4c26d1e5885305701be709a3d33442f.png

Click Open.

An SSH session window opens and PuTTY displays a security alert

asking if you trust the host you're connecting to.

Important

If you've

launched a public AMI, verify that the fingerprint in the security

alert matches the fingerprint from the output of

the ec2-get-console-output command.

If it doesn't, someone might be attempting a "man-in-the-middle"

attack.

Click Yes.

In the SSH session window, log in as

root (or ec2-user) if you didn't as part of starting the SSH

session.

Note

Some AMIs let

you log in as root, but some require you to log in with the

username ec2-user. For log in information for your chosen AMI,

contact your AMI provider directly or go

to Amazon Machine

Images(AMIs) page, then locate and click your

AMI on the list.

Note

If you

specified a passphrase when you converted your private key to

PuTTY's format, you must provide that passphrase when you log in to

the instance.

Transferring Files with PSCP

The PuTTY Secure Copy Client (PSCP)

is a command-line tool that lets you transfer files between your

Windows computer and your Linux/UNIX instance.

To use PSCP, you'll need the private

key you generated in Converting Your Private Key. You'll

also need the public IP address of your Linux/UNIX instance.

The following example transfers the

file sample_file.txt from

a Windows computer to the /usr/local directory

on a Linux/UNIX instance:

C:\>pscp -i C:\GSG_Keypair.ppk C:\sample_file.txt [email protected]:/usr/local/sample_file.txt

If you prefer a graphical user

interface (GUI), you can use an open source GUI tool named WinSCP.

For more information, go to the

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_29484843/article/details/116828902

智能推荐

OC - 时间日期类NSDate_weixin_30455067的博客-程序员宝宝

OC - 时间日期类NSDate //NSDate 时间日期类 NSDate 二进制数据流 { //1.获取当前时间 零时区的时间 //显示的是格林尼治的时间: 年-月-日 时:分:秒:+时区 NSDate *date = [NSDate date]; NSLo...

Golang中的字节序列化操作_weixin_34122810的博客-程序员宝宝

在写网络程序的时候,我们经常需要将结构体或者整数等数据类型序列化成二进制的buffer串。或者从一个buffer中解析出来一个结构体出来,最典型的就是在协议的header部分表征head length 或者body length在拼包和拆包的过程中,需要按照规定的整数类型进行解析,且涉及到大小端序的问题。1.C中是怎么操作的在C中我们最简单的方法是用memcpy来一个×××数...

简述现代计算机系统如何进行多级划分,计算机组成原理课后习题答案.doc_我说老李你说黑的博客-程序员宝宝

文档介绍:第一章计算机系统概论****题参考答案1. 比较数字计算机和模拟计算机的特点。解:模拟计算机的特点:数值由连续量来表示,运算过程是连续的;数字计算机的特点:数值由数字量(离散量)来表示,运算按位进行。两者主要区别见P1 表1.1。2. 数字计算机如何分类?分类的依据是什么?解:分类: 数字计算机分为专用计算机和通用计算机。通用计算机又分为巨型机、大型机、中型机、小型机、微型机和单片机六类...

最近大火的「元宇宙」是什么?_腾讯技术工程的博客-程序员宝宝

作者:腾讯技术工程特约撰稿人 李佳华本文将介绍元宇宙的由来和底层技术,探讨海内外资本在这条赛道上的布局,元宇宙将会对哪些行业产生变革的影响,这些影响背后凸显了元宇宙的哪些价值,以及元宇宙逐...

android实现对apk资源文件整体替换_huidawoxiaozi的博客-程序员宝宝

上一篇文章中我们实现了对资源文件的替换,但是有一个问题,就是得创建一个resource对象并使用这个resource对象才能实现对资源的替换,很麻烦,需要每个类去重写getResource方法。通过阅读framwork层源码发现ContextImpl类的构造方法中实现了对resource的赋值操作。 private ContextImpl(ContextImpl container, Acti...

docker安装mysql并配置文件_docker 安装mysql5.7 加my.cnf_梦醒马亡的博客-程序员宝宝

重点,复制之前的my.cnf 要能用,touch一个是不行的;1、先新建文件夹: mkdir -p /docker/mysql/{logs,conf,data}2、获取镜像:docker pull mysql:5.73、启动:docker run -p 3306:3306 --privileged=true -v /docker/mysql/logs:/logs -v /docker/mysql...

随便推点

linux standby模式,搭建11g 单机 linux standby 操作文档_weixin_39678089的博客-程序员宝宝

数据库环境oracle 11.1.0.6操作系统环境 linux redhat update 4 32位ORACLE_BASE为/u01/app/oracleORACLE_HOME为/u01/app/oracle/product/11.1.6/db_1主库数据文件存放目录/oradata/asm11g/下备库数据文件存放目录/oradata/standby/下1.配置主数据库为归档模式和强制使用日...

Halcon 直线拟合fit_line_contour_xld详解_智信仁勇严道的博客-程序员宝宝

fit_line_contour_xld原型fit_line_contour_xld(Contours : : Algorithm, MaxNumPoints, ClippingEndPoints, Iterations, ClippingFactor : RowBegin, ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)功能根据XLD轮廓拟合直线参数列表Contours (input_object) :输入的XLD轮廓Algorithm (input_cont

【迁移学习】Self-Supervised Learning for Domain Adaptation on Point Clouds_点云迁移学习_向上的毛毛的博客-程序员宝宝

摘要我们描述了点云上用于域自适应(DA)的自监督学习(SSL)的第一个研究。我们引入了一类新的伪装任务,形变重建,其灵感来自于sim-to-real 变换中遇到的形变。此外,我们还提出了一种基于混合方法的标签点云数据训练方法,称为点云混合(PCM)。对用于分类和分割的域适应数据集的评估表明,与现有方法和基线方法相比,该方法有了很大的改进。1.介绍自监督学习(SSL)最近被证明对于从未标记的图像或视频中学习有用的表征非常有效。关键思想是定义一个辅助的“借口”任务,使用有监督的技术进行训练,然后将学习到的

Unity5.X- 粒子系统,粒子沿着一定的轨迹运动的研究_unity粒子沿着曲线发射_懒慢慢的蜗牛的博客-程序员宝宝

最近项目有个需求就是模拟油管里的油流动的效果,想想让建模的直接做一个动画是最简单!不过,自己也想用粒子系统来实现一下!初期得到不错的效果!现在的需求就是这里有一根油管,当然不是一根直直的油管,会拐弯,油管里会有油在流动!找了很多资料也没有找到关于如何让粒子沿着路径运动的,那么自己开始动手吧!原理很简单,我们都知道粒子系统里有一个Velocity over LifeTime 这样一个属性,里

符号积分用的Rubi软件包(Mathematica下的Package)_stereohomology的博客-程序员宝宝

http://www.apmaths.uwo.ca/~arich/Rule-based MathematicsSymbolic Integration RulesCrafted by Albert D. Rich, Applied LogicianIf systematically applied, the integration rules provided on t

推荐文章

热门文章

相关标签