aws linux使用ssh登陆_在Mac上通过ssh连接到amazon aws linux服务器

有人问在Mac的一个简单的方法来创build〜/ .ssh文件夹将通过运行命令ssh-keygen,然后使用以下设置…

一个。

macbook-air$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/Users/sam/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /Users/sam/.ssh/id_rsa. Your public key has been saved in /Users/sam/.ssh/id_rsa.pub.

B.然后创build:

touch ~/.ssh/authorized_keys

C.修复权限:

chmod 600 ~/.ssh/authorized_keys

D.将AWS Key复制到该文件:

cp AWS_key.text ~sam/.ssh/authorized_keys

#在创buildEC2实例时,您应该先保存此SSH密钥

E.然后testingssh到AWS Linux服务器 – 你会看到这个错误:

ssh -i ./authorized_keys root@ec2-54-76-176-29.ap-southeast-2.compute.amazonaws.com

请以用户“ec2-user”而不是用户“root”的身份login。

F.重新尝试一下,它应该与允许的AWS用户“ec2-user”一起工作:

ssh -i ./authorized_keys ec2-user@ec2-54-76-176-29.ap-southeast-2.compute.amazonaws.com __| __|_ ) _| ( / Amazon Linux AMI ___|\___|___| https://aws.amazon.com/amazon-linux-ami/2014.09-release-notes/ 9 package(s) needed for security, out of 12 available Run "sudo yum update" to apply all updates.

希望这有所帮助,一切顺利。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值