Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Earlier today the following command worked:

ssh ssh://ubuntu@ourserver.com -i path/to/keyfile

Now it returns this error (with/without verbose):

Permission Denied (publickey)

On the host, when I tail /var/log/auth.log it shows:

invalid user ssh from ip.ip.ip.ip
input_userauth_request: invalid user ssh
connection closed by ip.ip.ip.ip

Between the time when it was working and now, I added a user (alex) and set their home directory to /home/ubuntu/alex for convention's sake. I also copied over the .bashrc, .profile and some other files into the new home directory.

Ubuntu's home is /home/ubuntu and .ssh is located inside that. .ssh has chmod 700

Any ideas to how I messed this one up? All the users loathe me right now.

The weirdest thing is that my bitvise tunellier ssh allows me to connect to the host, but I can't with the above command from git bash.

Thank you!

Edit: Here is /etc/ssh/sshd_config:

# 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
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

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

# 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 no

# 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
share|improve this question
    
Any ideas to how I messed this one up? All the users loathe me right now. Well, not blaming someone/something else comes to mind immediately. Practice the following phrase: "Canonical effed everything up again... I'll file a bug report and get with support for you right away." –  HopelessN00b Dec 20 '12 at 20:34
    
that would work if the users weren't more experienced sysadmins than I. I made the mess now I have to clean it up. –  Alex Waters Dec 20 '12 at 20:39
    
Sounds like you need to work on your BSing skills. It's an important part of being an SA, sadly. But either way, have to tried (or can you try) reverting the changes you made? –  HopelessN00b Dec 20 '12 at 20:46
    
I can't see history for that user. For some reason it's not persisting when I switch users =( –  Alex Waters Dec 20 '12 at 20:47
    
Does the simple ssh ubuntu@ourserver.com still work? –  ott-- Dec 20 '12 at 21:12

1 Answer 1

up vote 1 down vote accepted

Did you do some software update with new default config, instead of keeping old one?

I believe with following line stay commented, you cannot use ssh keys.

    #AuthorizedKeysFile %h/.ssh/authorized_keys

With no for the following, no password login.

    PasswordAuthentication no

You basically lock out everyone.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.