【问题标题】:Ec2 Market place Linux Instance Permission denied (publickey)Ec2 Marketplace Linux 实例权限被拒绝(公钥)
【发布时间】:2016-10-05 03:31:53
【问题描述】:

我有一个从 Marketplace 购买的 Wowza 实例,大约 4 小时前我能够连接它并对其进行一些操作。但是现在当我尝试连接时,它给出了 Permission denied (publickey) 错误。我使用 chmod 命令为 ./ 授予 777 权限,这是我认为的真正原因。

this solution 开始,当我尝试将此实例的根卷附加到相同类型的其他实例时,它会给出相同的错误,但是当分离 voulme 时,它​​会成功连接。市场实例的数量只能附加到类似类型的实例。

现在如何更改该 .ssh 目录的权限?你能帮帮我吗?

以下是我尝试连接实例时的日志:

OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 54.69.133.11 [54.69.133.11] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file Desktop/Shivam/mypemfile.pem type -1
debug1: identity file Desktop/Shivam/mypemfile.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 6a:48:f5:14:13:9a:a1:79:e8:44:bb:0d:6b:8d:b7:59
The authenticity of host '54.69.133.11 (54.69.133.11)' can't be established.
ECDSA key fingerprint is 6a:48:f5:14:13:9a:a1:79:e8:44:bb:0d:6b:8d:b7:59.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '54.69.133.11' (ECDSA) to the list of known hosts.
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: Desktop/Shivam/mypemfile.pem
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

【问题讨论】:

    标签: amazon-web-services ssh file-permissions


    【解决方案1】:

    从 AWS Marketplace 推出的产品具有非 Marketplace 实例主要用于强制许可的限制。您遇到了其中一项限制。

    这是 AWS 论坛上可能有用的相关 thread,尤其是线程中的最后一篇文章:

    如果卷具有 AWS Marketplace 产品代码:

    • 该卷只能附加到已停止的实例。
    • 您必须订阅卷上的 AWS Marketplace 代码。
    • 实例的配置(实例类型、操作系统)必须支持特定的 AWS Marketplace 代码。例如,你 无法从 Windows 实例获取卷并将其附加到 Linux 实例。
    • AWS Marketplace 产品代码从卷复制到实例。

    【讨论】:

    • 谢谢@jbird,但我正在寻找解决方案。我已经浏览过这篇文章和许多其他类似的文章。当我尝试连接到其他实例时会出现问题,我已经更新了我的问题以获得更多说明。
    【解决方案2】:

    我没有检查,但你可以试试这个技巧。

    您可以指定用户数据来配置实例或在启动期间运行配置脚本。 http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#user-data-shell-scripts

    当你创建一个新实例时

    1. 从 Market Place 中选择 AMI
    2. 选择实例类型
    3. 配置实例 -> 高级详细信息 -> 使用的数据。

      将您的 bash 脚本放在这里以更改权限。

    4. 添加存储

      更改根设备或从您的 EBS 快照添加一个新设备。

    5. 标签实例
    6. 配置安全组
    7. 审核和发布

    【讨论】:

      猜你喜欢
      • 2016-08-04
      • 1970-01-01
      • 2016-02-17
      • 1970-01-01
      • 2017-03-24
      • 2014-01-28
      • 1970-01-01
      • 2018-02-04
      • 2014-07-24
      相关资源
      最近更新 更多