Advertisement
Guest User

Untitled

a guest
Feb 25th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.62 KB | None | 0 0
  1. ➜ /home/troy
  2. ≫ ssh -vvv -i .ssh/id_rsa lenny@xxx.xxx.xxx.229 -p xxx40
  3. OpenSSH_7.4p1, OpenSSL 1.0.2k 26 Jan 2017
  4. debug1: Reading configuration data /etc/ssh/ssh_config
  5. debug2: resolving "xxx.xxx.xxx.229" port xxx40
  6. debug2: ssh_connect_direct: needpriv 0
  7. debug1: Connecting to xxx.xxx.xxx.229 [xxx.xxx.xxx.229] port xxx40.
  8. debug1: Connection established.
  9. debug1: identity file .ssh/id_rsa type 1
  10. debug1: key_load_public: No such file or directory
  11. debug1: identity file .ssh/id_rsa-cert type -1
  12. debug1: identity file /home/troy/.ssh/id_rsa type 1
  13. debug1: key_load_public: No such file or directory
  14. debug1: identity file /home/troy/.ssh/id_rsa-cert type -1
  15. debug1: Enabling compatibility mode for protocol 2.0
  16. debug1: Local version string SSH-2.0-OpenSSH_7.4
  17. debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
  18. debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 pat OpenSSH* compat 0x04000000
  19. debug2: fd 3 setting O_NONBLOCK
  20. debug1: Authenticating to xxx.xxx.xxx.229:xxx40 as 'lenny'
  21. debug3: put_host_port: [xxx.xxx.xxx.229]:xxx40
  22. debug3: hostkeys_foreach: reading file "/home/troy/.ssh/known_hosts"
  23. debug3: record_hostkey: found key type ECDSA in file /home/troy/.ssh/known_hosts:5
  24. debug3: load_hostkeys: loaded 1 keys from [xxx.xxx.xxx.229]:xxx40
  25. 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
  26. debug3: send packet: type 20
  27. debug1: SSH2_MSG_KEXINIT sent
  28. debug3: receive packet: type 20
  29. debug1: SSH2_MSG_KEXINIT received
  30. debug2: local client KEXINIT proposal
  31. debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
  32. debug2: host key algorithms: 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-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
  33. debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc
  34. debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc
  35. debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
  36. debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
  37. debug2: compression ctos: none,zlib@openssh.com,zlib
  38. debug2: compression stoc: none,zlib@openssh.com,zlib
  39. debug2: languages ctos:
  40. debug2: languages stoc:
  41. debug2: first_kex_follows 0
  42. debug2: reserved 0
  43. debug2: peer server KEXINIT proposal
  44. debug2: KEX algorithms: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
  45. debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
  46. debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
  47. debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
  48. debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
  49. debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
  50. debug2: compression ctos: none,zlib@openssh.com
  51. debug2: compression stoc: none,zlib@openssh.com
  52. debug2: languages ctos:
  53. debug2: languages stoc:
  54. debug2: first_kex_follows 0
  55. debug2: reserved 0
  56. debug1: kex: algorithm: curve25519-sha256@libssh.org
  57. debug1: kex: host key algorithm: ecdsa-sha2-nistp256
  58. debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
  59. debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
  60. debug3: send packet: type 30
  61. debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
  62. debug3: receive packet: type 31
  63. debug1: Server host key: ecdsa-sha2-nistp256 SHA256:M57GEOh/5elIh2RU446bRCamJ21QosRFOYaYx8u5Za4
  64. debug3: put_host_port: [xxx.xxx.xxx.229]:xxx40
  65. debug3: put_host_port: [xxx.xxx.xxx.229]:xxx40
  66. debug3: hostkeys_foreach: reading file "/home/troy/.ssh/known_hosts"
  67. debug3: record_hostkey: found key type ECDSA in file /home/troy/.ssh/known_hosts:5
  68. debug3: load_hostkeys: loaded 1 keys from [xxx.xxx.xxx.229]:xxx40
  69. debug3: hostkeys_foreach: reading file "/home/troy/.ssh/known_hosts"
  70. debug3: record_hostkey: found key type ECDSA in file /home/troy/.ssh/known_hosts:5
  71. debug3: load_hostkeys: loaded 1 keys from [xxx.xxx.xxx.229]:xxx40
  72. debug1: Host '[xxx.xxx.xxx.229]:xxx40' is known and matches the ECDSA host key.
  73. debug1: Found key in /home/troy/.ssh/known_hosts:5
  74. debug3: send packet: type 21
  75. debug2: set_newkeys: mode 1
  76. debug1: rekey after 134217728 blocks
  77. debug1: SSH2_MSG_NEWKEYS sent
  78. debug1: expecting SSH2_MSG_NEWKEYS
  79. debug3: receive packet: type 21
  80. debug1: SSH2_MSG_NEWKEYS received
  81. debug2: set_newkeys: mode 0
  82. debug1: rekey after 134217728 blocks
  83. debug2: key: .ssh/id_rsa (0x55a0c58221f0), explicit, agent
  84. debug2: key: /home/troy/.ssh/id_rsa (0x55a0c582fe00), agent
  85. debug3: send packet: type 5
  86. debug3: receive packet: type 7
  87. debug1: SSH2_MSG_EXT_INFO received
  88. debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
  89. debug3: receive packet: type 6
  90. debug2: service_accept: ssh-userauth
  91. debug1: SSH2_MSG_SERVICE_ACCEPT received
  92. debug3: send packet: type 50
  93. debug3: receive packet: type 51
  94. debug1: Authentications that can continue: publickey
  95. debug3: start over, passed a different list publickey
  96. debug3: preferred publickey,keyboard-interactive,password
  97. debug3: authmethod_lookup publickey
  98. debug3: remaining preferred: keyboard-interactive,password
  99. debug3: authmethod_is_enabled publickey
  100. debug1: Next authentication method: publickey
  101. debug1: Offering RSA public key: .ssh/id_rsa
  102. debug3: send_pubkey_test
  103. debug3: send packet: type 50
  104. debug2: we sent a publickey packet, wait for reply
  105. debug3: receive packet: type 51
  106. debug1: Authentications that can continue: publickey
  107. debug1: Offering RSA public key: /home/troy/.ssh/id_rsa
  108. debug3: send_pubkey_test
  109. debug3: send packet: type 50
  110. debug2: we sent a publickey packet, wait for reply
  111. debug3: receive packet: type 51
  112. debug1: Authentications that can continue: publickey
  113. debug2: we did not send a packet, disable method
  114. debug1: No more authentication methods to try.
  115. Permission denied (publickey).
  116.  
  117. lenny@Timubukuntu:~/.ssh$ ls -la
  118. total 12
  119. drwx------. 2 lenny lenny 4096 Feb 27 21:49 .
  120. drwxr-x---. 21 lenny lenny 4096 Feb 27 22:16 ..
  121. -rw-------. 1 lenny lenny 1146 Feb 27 20:35 authorized_keys
  122.  
  123. ➜ /home/troy/.ssh
  124. ≫ ls -la
  125. total 20
  126. drwx------ 2 troy users 4096 Feb 27 21:53 .
  127. drwx------ 30 troy users 4096 Feb 27 23:03 ..
  128. -rw------- 1 troy users 1679 Feb 27 20:32 id_rsa
  129. -rw-r--r-- 1 troy users 394 Feb 27 20:32 id_rsa.pub
  130. -rw-r--r-- 1 troy users 1416 Feb 27 15:13 known_hosts
  131.  
  132. lenny@Timubukuntu:/etc/ssh$ cat sshd_config
  133. # Package generated configuration file
  134. # See the sshd_config(5) manpage for details
  135.  
  136. # What ports, IPs and protocols we listen for
  137. Port xxx40
  138. # Use these options to restrict which interfaces/protocols sshd will bind to
  139. #ListenAddress ::
  140. #ListenAddress 0.0.0.0
  141. Protocol 2
  142. # HostKeys for protocol version 2
  143. HostKey /etc/ssh/ssh_host_rsa_key
  144. HostKey /etc/ssh/ssh_host_dsa_key
  145. HostKey /etc/ssh/ssh_host_ecdsa_key
  146. HostKey /etc/ssh/ssh_host_ed25519_key
  147. #Privilege Separation is turned on for security
  148. UsePrivilegeSeparation yes
  149.  
  150. # Lifetime and size of ephemeral version 1 server key
  151. KeyRegenerationInterval 3600
  152. ServerKeyBits 1024
  153.  
  154. # Logging
  155. SyslogFacility AUTH
  156. LogLevel INFO
  157.  
  158. # Authentication:
  159. LoginGraceTime 120
  160. PermitRootLogin prohibit-password
  161. StrictModes yes
  162.  
  163. RSAAuthentication yes
  164. PubkeyAuthentication yes
  165. AuthorizedKeysFile home/lenny/.ssh/authorized_keys
  166.  
  167. # Don't read the user's ~/.rhosts and ~/.shosts files
  168. IgnoreRhosts yes
  169. # For this to work you will also need host keys in /etc/ssh_known_hosts
  170. RhostsRSAAuthentication no
  171. # similar for protocol version 2
  172. HostbasedAuthentication no
  173. # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
  174. #IgnoreUserKnownHosts yes
  175.  
  176. # To enable empty passwords, change to yes (NOT RECOMMENDED)
  177. PermitEmptyPasswords no
  178.  
  179. # Change to yes to enable challenge-response passwords (beware issues with
  180. # some PAM modules and threads)
  181. ChallengeResponseAuthentication no
  182.  
  183. # Change to no to disable tunnelled clear text passwords
  184. PasswordAuthentication no
  185.  
  186. # Kerberos options
  187. #KerberosAuthentication no
  188. #KerberosGetAFSToken no
  189. #KerberosOrLocalPasswd yes
  190. #KerberosTicketCleanup yes
  191.  
  192. # GSSAPI options
  193. #GSSAPIAuthentication no
  194. #GSSAPICleanupCredentials yes
  195.  
  196. X11Forwarding yes
  197. X11DisplayOffset 10
  198. PrintMotd no
  199. PrintLastLog yes
  200. TCPKeepAlive yes
  201. #UseLogin no
  202.  
  203. #MaxStartups 10:30:60
  204. #Banner /etc/issue.net
  205.  
  206. # Allow client to pass locale environment variables
  207. AcceptEnv LANG LC_*
  208.  
  209. Subsystem sftp /usr/lib/openssh/sftp-server
  210.  
  211. # Set this to 'yes' to enable PAM authentication, account processing,
  212. # and session processing. If this is enabled, PAM authentication will
  213. # be allowed through the ChallengeResponseAuthentication and
  214. # PasswordAuthentication. Depending on your PAM configuration,
  215. # PAM authentication via ChallengeResponseAuthentication may bypass
  216. # the setting of "PermitRootLogin without-password".
  217. # If you just want the PAM account and session checks to run without
  218. # PAM authentication, then enable this but set PasswordAuthentication
  219. # and ChallengeResponseAuthentication to 'no'.
  220. UsePAM yes
  221.  
  222. Feb 27 22:52:31 Timubukuntu sshd[1901]: Connection closed by 67.20.206.135 port 36566 [preauth]
  223.  
  224. journalctl -f
  225. ....
  226. Feb 25 11:45:54 59a02b89e0f6 sshd[]: User user not allowed because shell /usr/bin/env /bin/bash does not exist
  227. ....
  228.  
  229. vi /etc/passwd
  230. ....
  231. user:x:1000:1000::/home/user:/bin/bash
  232. ....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement