我已經在Amazon EC2上安裝了一個tomcat,並且正在嘗試寫入/ home/ec2-user /文件夾中的一個文件夾。 但我沒有得到,因爲tomcat用戶有權限到該文件夾。通過ssh連接,無需訪問主文件夾
我試圖改變tomcat用戶的所有者,但都沒有。 我想也許文件夾/家/ ec2用戶/是問題,然後改變到該文件夾的權限...但沒有奏效。
在互聯網上搜索我發現了命令setenforce 0
,但它沒有奏效。
然後我關閉會話,當我嘗試再次登錄收到以下消息
ssh -i "Amazon-Tomcat.pem" [email protected]
Permission denied (publickey).
我想,也許是因爲我有到/ home/EC2用戶/然後嘗試根本進不去但我得到
ssh -i "Amazon-Tomcat.pem" [email protected]
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" [email protected] -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 [email protected] none
debug1: kex: client->server aes128-ctr [email protected] 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」呢? (是的,這是一個奇怪的文件名,但是我只是在看了一下手冊頁後才猜出來。) –
哦,爲什麼這個標記爲「膩子」?在問題中沒有putty,'ssh'語法看起來像OpenSSH語法。 –
@AxelBeckert謝謝,但我從亞馬遜下載文件。我總是使用這些命令登錄 – user60108