【发布时间】:2016-08-21 01:19:16
【问题描述】:
我已经在 Amazon EC2 上安装了一个 tomcat,并且我正在尝试将应用程序写入 /home/ec2-user/folder 中的文件夹中。 但我没有得到,因为tomcat用户拥有该文件夹的权限。
我试图更改 tomcat 用户的所有者,但都没有。 我想也许文件夹 / home / ec2-user / 是问题然后更改为该文件夹权限......但没有工作。
在网上搜索找到了setenforce 0这个命令,但是没有用。
然后我关闭会话,当我再次尝试登录时收到以下消息
ssh -i "Amazon-Tomcat.pem" ec2-user@ec2-52-39-23-66.us-west-2.compute.amazonaws.com
Permission denied (publickey).
我想可能是因为我无权访问 /home/ec2-user / 然后尝试 root 但我得到了
ssh -i "Amazon-Tomcat.pem" root@ec2-52-39-23-66.us-west-2.compute.amazonaws.com
Please login as the user "ec2-user" rather than the user "root".
Connection to ec2-52-39-23-66.us-west-2.compute.amazonaws.com closed.
如果我在连接命令中使用 -v 会收到以下消息
ssh -i "Amazon-Tomcat.pem" ec2-user@ec2-52-39-23-66.us-west-2.compute.amazonaws.com -v
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 ec2-52-39-23-66.us-west-2.compute.amazonaws.com [52.39.23.66] port 22.
debug1: Connection established.
debug1: identity file Amazon-Tomcat.pem type -1
debug1: identity file Amazon-Tomcat.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.6
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 21:76:3c:72:dd:68:14:c5:83:a6:09:9a:80:26:74:bc
debug1: Host 'ec2-52-39-23-66.us-west-2.compute.amazonaws.com' is known and matches the ECDSA host key.
debug1: Found key in /home/rodrigo/.ssh/known_hosts:7
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: Offering RSA public key: OpenShift-Key
debug1: Authentications that can continue: publickey
debug1: Trying private key: Amazon-Tomcat.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-Tomcat.pem是 PEM 格式的 SSL 客户端证书。这也是证书的文件名吗?根据 ssh 手册页,“ssh 还将尝试从通过将 -cert.pub 附加到身份文件名获得的文件名中加载证书信息。”所以也许你的文件需要命名为Amazon-Tomcat.pem-cert.pub? (是的,这是一个奇怪的文件名,但我只是在看了一眼手册页后猜测。) -
哦,为什么这个标签是“腻子”?问题中没有腻子,
ssh语法看起来像 OpenSSH 语法。 -
@AxelBeckert 谢谢,但我从亚马逊下载了文件。我总是使用这些命令登录
标签: amazon-web-services ssh amazon-ec2