2015-04-06 50 views
-3

我正在拉我的頭髮。我創建了一個新的VPS,我創建了一個新用戶,而且我無法登錄!我試圖從各種可能的方式解決它,但我只是運行了我們的想法。因此,這裏是發生了什麼新的Ubuntu 14.04 VPS,無法以新用戶身份登錄

新用戶:演示

[email protected]:~$ ssh -vvv [email protected] 
OpenSSH_5.9p1 Debian-5ubuntu1.4, OpenSSL 1.0.1 14 Mar 2012 
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 120.138.22.113 [120.138.22.113] port 22. 
debug1: Connection established. 
debug3: Incorrect RSA1 identifier 
debug3: Could not load "/home/ralf/.ssh/id_rsa" as a RSA1 public key 
debug1: identity file /home/ralf/.ssh/id_rsa type 1 
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048 
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048 
debug1: identity file /home/ralf/.ssh/id_rsa-cert type -1 
debug1: identity file /home/ralf/.ssh/id_dsa type -1 
debug1: identity file /home/ralf/.ssh/id_dsa-cert type -1 
debug1: identity file /home/ralf/.ssh/id_ecdsa type -1 
debug1: identity file /home/ralf/.ssh/id_ecdsa-cert type -1 
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH* 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.4 
debug2: fd 3 setting O_NONBLOCK 
debug3: load_hostkeys: loading entries for host "120.138.22.113" from file "/home/ralf/.ssh/known_hosts" 
debug3: load_hostkeys: found key type ECDSA in file /home/ralf/.ssh/known_hosts:9 
debug3: load_hostkeys: loaded 1 keys 
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],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: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],[email protected],[email protected],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,[email protected] 
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,[email protected] 
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
debug2: kex_parse_kexinit: none,[email protected],zlib 
debug2: kex_parse_kexinit: none,[email protected],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: [email protected],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,ssh-ed25519 
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] 
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] 
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
debug2: kex_parse_kexinit: none,[email protected] 
debug2: kex_parse_kexinit: none,[email protected] 
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 12:a7:fb:0b:18:b7:ed:37:bc:57:e1:e4:a6:47:f7:69 
debug3: load_hostkeys: loading entries for host "120.138.22.113" from file "/home/ralf/.ssh/known_hosts" 
debug3: load_hostkeys: found key type ECDSA in file /home/ralf/.ssh/known_hosts:9 
debug3: load_hostkeys: loaded 1 keys 
debug1: Host '120.138.22.113' is known and matches the ECDSA host key. 
debug1: Found key in /home/ralf/.ssh/known_hosts:9 
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/ralf/.ssh/id_rsa (0x7f49ad843800) 
debug2: key: /home/ralf/.ssh/id_dsa ((nil)) 
debug2: key: /home/ralf/.ssh/id_ecdsa ((nil)) 
debug1: Authentications that can continue: publickey,password 
debug3: start over, passed a different list publickey,password 
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: Offering RSA public key: /home/ralf/.ssh/id_rsa 
debug3: send_pubkey_test 
debug2: we sent a publickey packet, wait for reply 
debug1: Authentications that can continue: publickey,password 
debug1: Trying private key: /home/ralf/.ssh/id_dsa 
debug3: no such identity: /home/ralf/.ssh/id_dsa 
debug1: Trying private key: /home/ralf/.ssh/id_ecdsa 
debug3: no such identity: /home/ralf/.ssh/id_ecdsa 
debug2: we did not send a packet, disable method 
debug3: authmethod_lookup password 
debug3: remaining preferred: ,password 
debug3: authmethod_is_enabled password 
debug1: Next authentication method: password 
[email protected]'s password: 
debug3: packet_send2: adding 48 (len 66 padlen 14 extra_pad 64) 
debug2: we sent a password packet, wait for reply 
debug1: Authentication succeeded (password). 
Authenticated to 120.138.22.113 ([120.138.22.113]:22). 
debug1: channel 0: new [client-session] 
debug3: ssh_session2_open: channel_new: 0 
debug2: channel 0: send open 
debug1: Requesting [email protected] 
debug1: Entering interactive session. 
debug2: callback start 
debug2: client_session2_setup: id 0 
debug2: fd 3 setting TCP_NODELAY 
debug2: channel 0: request pty-req confirm 1 
debug1: Sending environment. 
debug3: Ignored env TERM 
debug3: Ignored env SHELL 
debug3: Ignored env SSH_CLIENT 
debug3: Ignored env SSH_TTY 
debug3: Ignored env USER 
debug3: Ignored env MAIL 
debug3: Ignored env PATH 
debug3: Ignored env PWD 
debug1: Sending env LANG = en_NZ.UTF-8 
debug2: channel 0: request env confirm 0 
debug3: Ignored env SHLVL 
debug3: Ignored env HOME 
debug3: Ignored env LOGNAME 
debug3: Ignored env SSH_CONNECTION 
debug3: Ignored env _ 
debug2: channel 0: request shell confirm 1 
debug2: callback done 
debug2: channel 0: open confirm rwindow 0 rmax 32768 
debug2: channel_input_status_confirm: type 99 id 0 
debug2: PTY allocation request accepted on channel 0 
debug2: channel 0: rcvd adjust 2097152 
debug2: channel_input_status_confirm: type 99 id 0 
debug2: shell request accepted on channel 0 
Last login: Mon Apr 6 18:43:25 2015 from 120.138.30.180 
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0 
debug2: channel 0: rcvd eow 
debug2: channel 0: close_read 
debug2: channel 0: input open -> closed 
debug2: channel 0: rcvd eof 
debug2: channel 0: output open -> drain 
debug2: channel 0: obuf empty 
debug2: channel 0: close_write 
debug2: channel 0: output drain -> closed 
debug2: channel 0: rcvd close 
debug3: channel 0: will not send data after close 
debug2: channel 0: almost dead 
debug2: channel 0: gc: notify user 
debug2: channel 0: gc: user detached 
debug2: channel 0: send close 
debug2: channel 0: is dead 
debug2: channel 0: garbage collecting 
debug1: channel 0: free: client-session, nchannels 1 
debug3: channel 0: status: The following connections are open: 
    #0 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1) 

Connection to 120.138.22.113 closed. 
Transferred: sent 2488, received 2408 bytes, in 0.0 seconds 
Bytes per second: sent 195182.4, received 188906.5 
debug1: Exit status 1 

首先,我想有一些錯誤的權限,但是當我惱火,我把它改爲777,仍然一無所獲:

drwxrwxrwx 4 demo demo_group 4096 Apr 1 15:23 demo 

然後我認爲有一些問題與SSH配置,但我看不出有什麼不妥,我甚至添加「AllowUsers」,看看它是否會有所幫助:

# Package generated configuration file 
# See the sshd_config(5) manpage for details 

# What ports, IPs and protocols we listen for 
Port 22 
# Use these options to restrict which interfaces/protocols sshd will bind to 
#ListenAddress :: 
#ListenAddress 0.0.0.0 
Protocol 2 
# HostKeys for protocol version 2 
HostKey /etc/ssh/ssh_host_rsa_key 
HostKey /etc/ssh/ssh_host_dsa_key 
HostKey /etc/ssh/ssh_host_ecdsa_key 
HostKey /etc/ssh/ssh_host_ed25519_key 
#Privilege Separation is turned on for security 
UsePrivilegeSeparation yes 

# Lifetime and size of ephemeral version 1 server key 
KeyRegenerationInterval 3600 
ServerKeyBits 1024 

# Logging 
SyslogFacility AUTH 
LogLevel INFO 

# Authentication: 
LoginGraceTime 120 
PermitRootLogin yes 
StrictModes yes 

RSAAuthentication yes 
PubkeyAuthentication yes 
#AuthorizedKeysFile  %h/.ssh/authorized_keys 

# Don't read the user's ~/.rhosts and ~/.shosts files 
IgnoreRhosts yes 
# For this to work you will also need host keys in /etc/ssh_known_hosts 
RhostsRSAAuthentication no 
# similar for protocol version 2 
HostbasedAuthentication 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 yes 

X11Forwarding yes 
X11DisplayOffset 10 
PrintMotd no 
PrintLastLog yes 
TCPKeepAlive yes 
#UseLogin no 

#MaxStartups 10:30:60 
#Banner /etc/issue.net 

# Allow client to pass locale environment variables 
AcceptEnv 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 
AllowUsers root demo 

所以我想好了,一定有東西我錯了,但後來我以root身份登錄,並試圖看看我是否能爲用戶機器內登錄:

[email protected]:/home# su - demo 
[email protected]:/home# 

而這正是AUTH說: 4月6日18點50分03秒STA

ging su[19807]: Successful su for demo by root 
Apr 6 18:50:03 staging su[19807]: + /dev/pts/0 root:demo 
Apr 6 18:50:03 staging su[19807]: pam_unix(su:session): session opened for user demo by root(uid=0) 
Apr 6 18:50:03 staging su[19807]: pam_unix(su:session): session closed for user demo 

我完全跑出的想法,有幾乎一無所有的日誌,我只是失去了。任何幫助非常感謝!

+0

不是編程問題 - 請嘗試http://askubuntu.com? – 2015-04-06 06:58:01

+0

這個系統在哪裏託管?圖像附帶的說明是什麼? – hd1 2015-04-06 06:59:13

+0

@ hd1沒有說明,它似乎像圖像稍微修改,但沒有指示新的圖像:http://www.sitehost.co.nz/ – Ralf 2015-04-06 07:14:02

回答

0

我坐在支持,我們無法找到問題。這是那些從未解決的神祕問題之一。

解決方案最後,我們刪除了帳戶,並重新創建它,並出於一些神奇的原因,它開始立即開始工作。