У меня есть настройка сервера Ubuntu с использованием экземпляра amazon ec2. Мне нужно подключить свой рабочий стол (который также является компьютером ubuntu) к серверу ubuntu с помощью SSH.
Я установил open-ssh на сервере ubuntu. Мне нужно, чтобы все системы моей сети подключались к серверу ubuntu с помощью SSH (нет необходимости подключаться через ключи pem или pub).
Следовательно, я открыл SSH-порт 22 для моего статического IP-адреса в группах безопасности (AWS).
Мой конфигурационный файл SSHD - это:
# Package generated configuration file# See the sshd_config(5) manpage for details# What ports, IPs and protocols we listen forPort 22# Use these options to restrict which interfaces/protocols sshd will bind to#ListenAddress ::#ListenAddress 0.0.0.0Protocol 2# HostKeys for protocol version 2HostKey /etc/ssh/ssh_host_rsa_keyHostKey /etc/ssh/ssh_host_dsa_keyHostKey /etc/ssh/ssh_host_ecdsa_key#Privilege Separation is turned on for securityUsePrivilegeSeparation yes# Lifetime and size of ephemeral version 1 server keyKeyRegenerationInterval 3600ServerKeyBits 768# LoggingSyslogFacility AUTHLogLevel INFO# Authentication:LoginGraceTime 120PermitRootLogin yesStrictModes yesRSAAuthentication yesPubkeyAuthentication yes#AuthorizedKeysFile %h/.ssh/authorized_keys# Don't read the user's ~/.rhosts and ~/.shosts filesIgnoreRhosts yes# For this to work you will also need host keys in /etc/ssh_known_hostsRhostsRSAAuthentication no# similar for protocol version 2HostbasedAuthentication no# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication#IgnoreUserKnownHosts yes# To enable empty passwords, change to yes (NOT RECOMMENDED)PermitEmptyPasswords no# Change to yes to enable challenge-response passwords (beware issues with# some PAM modules and threads)ChallengeResponseAuthentication no# Change to no to disable tunnelled clear text passwords#PasswordAuthentication yes# Kerberos options#KerberosAuthentication no#KerberosGetAFSToken no#KerberosOrLocalPasswd yes#KerberosTicketCleanup yes# GSSAPI options#GSSAPIAuthentication no#GSSAPICleanupCredentials yesX11Forwarding yesX11DisplayOffset 10PrintMotd noPrintLastLog yesTCPKeepAlive yes#UseLogin no#MaxStartups 10:30:60#Banner /etc/issue.net# Allow client to pass locale environment variablesAcceptEnv LANG LC_*Subsystem sftp /usr/lib/openssh/sftp-server# Set this to 'yes' to enable PAM authentication, account processing,# and session processing. If this is enabled, PAM authentication will# be allowed through the ChallengeResponseAuthentication and# PasswordAuthentication. Depending on your PAM configuration,# PAM authentication via ChallengeResponseAuthentication may bypass# the setting of "PermitRootLogin without-password".# If you just want the PAM account and session checks to run without# PAM authentication, then enable this but set PasswordAuthentication# and ChallengeResponseAuthentication to 'no'.UsePAM yes
Через webmin (командную оболочку) я создал нового пользователя с именем 'senthil' и добавил этого нового пользователя в группу 'sudo'.
sudo adduser -y senthilsudo adduser senthil sudo
Я попытался войти в систему, используя этого нового пользователя "senthil" в "webmin". Я смог успешно войти в систему.
Когда я попытался подключить сервер ubuntu со своего терминала через SSH,
ssh senthil@SERVER_IP
Он попросил меня ввести пароль. После ввода пароля он отобразил:
Permission denied, please try again.
Проведя некоторые исследования, я понял, что для этого мне нужно отслеживать журнал авторизации моего сервера. Я получил следующую ошибку в своем журнале авторизации (/var/log/auth.log)
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=senthilJul 2 09:38:09 ip-192-xx-xx-xxx sshd[3037]: Failed password for senthil from MY_CLIENT_IP port 39116 ssh2
Когда я попытался выполнить отладку с помощью:
ssh -v senthil@SERVER_IP OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012debug1: Reading configuration data /etc/ssh/ssh_configdebug1: /etc/ssh/ssh_config line 19: Applying options for *debug1: Connecting to SERVER_IP [SERVER_IP] port 22.debug1: Connection established.debug1: identity file {MY-WORKSPACE}/.ssh/id_rsa type 1debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048debug1: identity file {MY-WORKSPACE}/.ssh/id_rsa-cert type -1debug1: identity file {MY-WORKSPACE}/.ssh/id_dsa type -1debug1: identity file {MY-WORKSPACE}/.ssh/id_dsa-cert type -1debug1: identity file {MY-WORKSPACE}/.ssh/id_ecdsa type -1debug1: identity file {MY-WORKSPACE}/.ssh/id_ecdsa-cert type -1debug1: Remote protocol version 2.0, remote software version OpenSSH_5.8p1 Debian-7ubuntu1debug1: match: OpenSSH_5.8p1 Debian-7ubuntu1 pat OpenSSH*debug1: Enabling compatibility mode for protocol 2.0debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1debug1: SSH2_MSG_KEXINIT sentdebug1: SSH2_MSG_KEXINIT receiveddebug1: kex: server->client aes128-ctr hmac-md5 nonedebug1: kex: client->server aes128-ctr hmac-md5 nonedebug1: sending SSH2_MSG_KEX_ECDH_INITdebug1: expecting SSH2_MSG_KEX_ECDH_REPLYdebug1: Server host key: ECDSA {SERVER_HOST_KEY}debug1: Host 'SERVER_IP' is known and matches the ECDSA host key.debug1: Found key in {MY-WORKSPACE}/.ssh/known_hosts:1debug1: ssh_ecdsa_verify: signature correctdebug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug1: SSH2_MSG_NEWKEYS receiveddebug1: Roaming not allowed by serverdebug1: SSH2_MSG_SERVICE_REQUEST sentdebug1: SSH2_MSG_SERVICE_ACCEPT receiveddebug1: Authentications that can continue: passworddebug1: Next authentication method: passwordsenthil@SERVER_IP's password: debug1: Authentications that can continue: passwordPermission denied, please try again.senthil@SERVER_IP's password:
Для пароля я ввел то же значение, которое я обычно использую для пользователя "ubuntu".
Может кто-нибудь, пожалуйста, указать мне, в чем проблема, и предложить какое-то решение этой проблемы?