Guest User

Untitled

a guest
Jun 12th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.40 KB | None | 0 0
  1. # Package generated configuration file
  2. # See the sshd_config(5) manpage for details
  3.  
  4. # What ports, IPs and protocols we listen for
  5. Port 22
  6. # Use these options to restrict which interfaces/protocols sshd will bind to
  7. #ListenAddress ::
  8. #ListenAddress 0.0.0.0
  9. Protocol 2
  10. # HostKeys for protocol version 2
  11. HostKey /etc/ssh/ssh_host_rsa_key
  12. HostKey /etc/ssh/ssh_host_dsa_key
  13. HostKey /etc/ssh/ssh_host_ecdsa_key
  14. #Privilege Separation is turned on for security
  15. UsePrivilegeSeparation yes
  16.  
  17. # Lifetime and size of ephemeral version 1 server key
  18. KeyRegenerationInterval 3600
  19. ServerKeyBits 768
  20.  
  21. # Logging
  22. SyslogFacility AUTH
  23. LogLevel INFO
  24.  
  25. # Authentication:
  26. LoginGraceTime 120
  27. PermitRootLogin yes
  28. StrictModes yes
  29.  
  30. RSAAuthentication yes
  31. PubkeyAuthentication yes
  32. #AuthorizedKeysFile %h/.ssh/authorized_keys
  33.  
  34. # Don't read the user's ~/.rhosts and ~/.shosts files
  35. IgnoreRhosts yes
  36. # For this to work you will also need host keys in /etc/ssh_known_hosts
  37. RhostsRSAAuthentication no
  38. # similar for protocol version 2
  39. HostbasedAuthentication no
  40. # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
  41. #IgnoreUserKnownHosts yes
  42.  
  43. # To enable empty passwords, change to yes (NOT RECOMMENDED)
  44. PermitEmptyPasswords no
  45.  
  46. # Change to yes to enable challenge-response passwords (beware issues with
  47. # some PAM modules and threads)
  48. ChallengeResponseAuthentication no
  49.  
  50. # Change to no to disable tunnelled clear text passwords
  51. #PasswordAuthentication yes
  52.  
  53. # Kerberos options
  54. #KerberosAuthentication no
  55. #KerberosGetAFSToken no
  56. #KerberosOrLocalPasswd yes
  57. #KerberosTicketCleanup yes
  58.  
  59. # GSSAPI options
  60. #GSSAPIAuthentication no
  61. #GSSAPICleanupCredentials yes
  62.  
  63. X11Forwarding yes
  64. X11DisplayOffset 10
  65. PrintMotd no
  66. PrintLastLog yes
  67. TCPKeepAlive yes
  68. #UseLogin no
  69.  
  70. #MaxStartups 10:30:60
  71. #Banner /etc/issue.net
  72.  
  73. # Allow client to pass locale environment variables
  74. AcceptEnv LANG LC_*
  75.  
  76. Subsystem sftp /usr/lib/openssh/sftp-server
  77.  
  78. # Set this to 'yes' to enable PAM authentication, account processing,
  79. # and session processing. If this is enabled, PAM authentication will
  80. # be allowed through the ChallengeResponseAuthentication and
  81. # PasswordAuthentication. Depending on your PAM configuration,
  82. # PAM authentication via ChallengeResponseAuthentication may bypass
  83. # the setting of "PermitRootLogin without-password".
  84. # If you just want the PAM account and session checks to run without
  85. # PAM authentication, then enable this but set PasswordAuthentication
  86. # and ChallengeResponseAuthentication to 'no'.
  87. UsePAM yes
  88.  
  89. sudo adduser -y senthil
  90. sudo adduser senthil sudo
  91.  
  92. ssh senthil@SERVER_IP
  93.  
  94. Permission denied, please try again.
  95.  
  96. Jul 2 09:38:07 ip-192-xx-xx-xxx sshd[3037]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=MY_CLIENT_IP user=senthil
  97. Jul 2 09:38:09 ip-192-xx-xx-xxx sshd[3037]: Failed password for senthil from MY_CLIENT_IP port 39116 ssh2
  98.  
  99. ssh -v senthil@SERVER_IP
  100.  
  101.  
  102. OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
  103. debug1: Reading configuration data /etc/ssh/ssh_config
  104. debug1: /etc/ssh/ssh_config line 19: Applying options for *
  105. debug1: Connecting to SERVER_IP [SERVER_IP] port 22.
  106. debug1: Connection established.
  107. debug1: identity file {MY-WORKSPACE}/.ssh/id_rsa type 1
  108. debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
  109. debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
  110. debug1: identity file {MY-WORKSPACE}/.ssh/id_rsa-cert type -1
  111. debug1: identity file {MY-WORKSPACE}/.ssh/id_dsa type -1
  112. debug1: identity file {MY-WORKSPACE}/.ssh/id_dsa-cert type -1
  113. debug1: identity file {MY-WORKSPACE}/.ssh/id_ecdsa type -1
  114. debug1: identity file {MY-WORKSPACE}/.ssh/id_ecdsa-cert type -1
  115. debug1: Remote protocol version 2.0, remote software version OpenSSH_5.8p1 Debian-7ubuntu1
  116. debug1: match: OpenSSH_5.8p1 Debian-7ubuntu1 pat OpenSSH*
  117. debug1: Enabling compatibility mode for protocol 2.0
  118. debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1
  119. debug1: SSH2_MSG_KEXINIT sent
  120. debug1: SSH2_MSG_KEXINIT received
  121. debug1: kex: server->client aes128-ctr hmac-md5 none
  122. debug1: kex: client->server aes128-ctr hmac-md5 none
  123. debug1: sending SSH2_MSG_KEX_ECDH_INIT
  124. debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
  125. debug1: Server host key: ECDSA {SERVER_HOST_KEY}
  126. debug1: Host 'SERVER_IP' is known and matches the ECDSA host key.
  127. debug1: Found key in {MY-WORKSPACE}/.ssh/known_hosts:1
  128. debug1: ssh_ecdsa_verify: signature correct
  129. debug1: SSH2_MSG_NEWKEYS sent
  130. debug1: expecting SSH2_MSG_NEWKEYS
  131. debug1: SSH2_MSG_NEWKEYS received
  132. debug1: Roaming not allowed by server
  133. debug1: SSH2_MSG_SERVICE_REQUEST sent
  134. debug1: SSH2_MSG_SERVICE_ACCEPT received
  135. debug1: Authentications that can continue: password
  136. debug1: Next authentication method: password
  137. senthil@SERVER_IP's password:
  138. debug1: Authentications that can continue: password
  139. Permission denied, please try again.
  140. senthil@SERVER_IP's password:
  141.  
  142. -L, --lock
  143. Lock a user's password. This puts a '!' in front of the encrypted password,
  144. effectively disabling the password.
  145.  
  146. ubuntu:!$6$rWDSG...HSi1:15347:0:99999:7:::
  147.  
  148. usermod -U ubuntu
  149.  
  150. sudo adduser username
  151.  
  152. sudo adduser username sudo
  153.  
  154. sudo su -l ubuntu
  155.  
  156. PermitRootLogin yes
  157.  
  158. AllowUsers otheruser
  159.  
  160. AllowUsers senthil
  161.  
  162. ssh senthil@yourhostname
  163.  
  164. # Example of overriding settings on a per-user basis
  165. #Match User anoncvs
  166. # X11Forwarding no
  167. # AllowTcpForwarding no
  168. # ForceCommand cvs server
  169. Ciphers aes128-ctr,aes192-ctr,aes256-ctr
  170. ClientAliveInterval 432000
  171. ClientAliveCountMax 0
  172. #AllowUsers TestUser
Add Comment
Please, Sign In to add comment