[Question] Không connect ssh được |
09/12/2012 21:46:40 (+0700) | #1 | 271669 |
dnv2006
Member
|
0 |
|
|
Joined: 08/02/2009 02:27:30
Messages: 96
Offline
|
|
Chào mọi người,
mình cần kết nối ssh với một máy chủ cloud (Ubuntu Precise 12.04 LTS Server 64-bit 20120424 )
hôm trước mò mẫm thế nào connect được nhưng hôm nay lại không làm được.
Hệ thống có hướng dẫn:
Code:
Instance: 585858 (Mã số 585858 do hệ thống cấp phát)
To access via SSH:
1. Locate the private key for the key pair named abc (abc: do mình đã tạo)
2. For SSH to work, ensure your key is protected:
chmod 400 abc.pem
3. Open your SSH client (such as Terminal).
4. Connect via your server's IP address: 15.185.124.130
Example: ssh -i abc.pem root@15.185.124.130
Đã đặt file abc.pem vào root, chmod là 400
-r-------- 1 root root 887 Dec 7 14:24 abc.pem
Trên hệ điều hành ubuntu đang dùng, gõ lệnh
ssh -i abc.pem root@15.185.124.130
thì được thông báo là:
Code:
Permission denied (publickey)
Do mới tiếp xúc + kỹ năng hạn chế, mọi người chỉ giúp cách khắc phục, hoặc tài liệu liên quan để tham khảo (cả về connect ssh, cả về thao tác với máy chủ từ xa).
Xin cảm ơn! |
|
|
|
|
[Question] Không connect ssh được |
09/12/2012 21:57:36 (+0700) | #2 | 271670 |
dnv2006
Member
|
0 |
|
|
Joined: 08/02/2009 02:27:30
Messages: 96
Offline
|
|
đoạn này bị tự động chuyển thành: <a href="mailto:root@15.185.124.130">root@15.185.124.130</a> đã sửa lại, cho ra ngoài thẻ [code]
|
|
|
|
|
[Question] Không connect ssh được |
09/12/2012 22:24:38 (+0700) | #3 | 271671 |
|
quanta
Moderator
|
Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
|
|
Bạn chạy `ssh -vvv -i abc.pem root@ip` rồi gửi kết quả lên nhé.
đoạn `root@ip` bị tự động chuyển thành: <a href="mailto:root@ip">root@ip</a> đã sửa lại, cho ra ngoài thẻ [ code ]
Anh conmale sửa chỗ này đi ạ. Cả mấy cái hai chấm D bị biến thành mặt cười nữa anh nhé. Dễ đến 5 năm rồi chứ không ít. |
|
Let's build on a great foundation! |
|
|
|
[Question] Không connect ssh được |
09/12/2012 22:41:22 (+0700) | #4 | 271672 |
dnv2006
Member
|
0 |
|
|
Joined: 08/02/2009 02:27:30
Messages: 96
Offline
|
|
Kết quả là:
dnv@dnv:~$ ssh -vvv -i abc.pem root@15.185.124.130
OpenSSH_6.0p1 Debian-3ubuntu1, OpenSSL 1.0.1c 10 May 2012
Warning: Identity file abc.pem not accessible: No such file or directory.
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 15.185.124.130 [15.185.124.130] port 22.
debug1: Connection established.
debug1: identity file /home/dnv/.ssh/id_rsa type -1
debug1: identity file /home/dnv/.ssh/id_rsa-cert type -1
debug1: identity file /home/dnv/.ssh/id_dsa type -1
debug1: identity file /home/dnv/.ssh/id_dsa-cert type -1
debug1: identity file /home/dnv/.ssh/id_ecdsa type -1
debug1: identity file /home/dnv/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1 pat OpenSSH_5*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-3ubuntu1
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "15.185.124.130" from file "/home/dnv/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /home/dnv/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 9d:52:4c:18:b3:43:44:3a:23:38:63:43:35:97:b0:55
debug3: load_hostkeys: loading entries for host "15.185.124.130" from file "/home/dnv/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /home/dnv/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug1: Host '15.185.124.130' is known and matches the ECDSA host key.
debug1: Found key in /home/dnv/.ssh/known_hosts:1
debug1: ssh_ecdsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/dnv/.ssh/id_rsa ((nil))
debug2: key: /home/dnv/.ssh/id_dsa ((nil))
debug2: key: /home/dnv/.ssh/id_ecdsa ((nil))
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/dnv/.ssh/id_rsa
debug3: no such identity: /home/dnv/.ssh/id_rsa
debug1: Trying private key: /home/dnv/.ssh/id_dsa
debug3: no such identity: /home/dnv/.ssh/id_dsa
debug1: Trying private key: /home/dnv/.ssh/id_ecdsa
debug3: no such identity: /home/dnv/.ssh/id_ecdsa
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
|
|
|
|
|
[Question] Không connect ssh được |
09/12/2012 22:45:52 (+0700) | #5 | 271673 |
|
quanta
Moderator
|
Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
|
|
Warning: Identity file abc.pem not accessible: No such file or directory.
Đã đặt file abc.pem vào root, chmod là 400
-r-------- 1 root root 887 Dec 7 14:24 abc.pem
--> là thư mục HOME của root hay là ở đâu? |
|
Let's build on a great foundation! |
|
[Question] Không connect ssh được |
09/12/2012 23:02:48 (+0700) | #6 | 271674 |
dnv2006
Member
|
0 |
|
|
Joined: 08/02/2009 02:27:30
Messages: 96
Offline
|
|
đặt *.pem vào cùng cấp với thư mục etc lib bin opt boot dev v.v.. |
|
|
|