Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I started with a box at Google Compute Engine (Google's cloud service) with an account named xyz and an ephemeral IP address.

Let's pretend the ephemeral IP address was 2.3.4.5.

Before I started the process below, I was able to login to xyz@2.3.4.5 with a password.

I then attached a static IP address. Let's pretend the static IP address was 1.2.3.4.

I then typed

my@localbox:~$ ssh-copy-id xyz@1.2.3.4

The command seem to hang, so I killed the terminal.

I then did a simple

my@localbox:~$ ssh xyz@1.2.3.4

Which succeeded without prompting me for a password.

I assumed that my key had made it into my authorized_keys, so I did

xyz@cloudbox:~$ ls -al

To my surprise, .ssh contained only a known_hosts file, not an authorized_keys file.

Additionally, the command

my@localbox:~$ ssh-copy-id xyz@1.2.3.4

still hangs when I try it, so it wasn't just a random fluke.

How am I able to login to this account without a password if there's no .ssh/authorized_keys file? Is it related to the cause of ssh-copy-id hanging?

share|improve this question
    
can you paste the servers sshd.conf? –  Gotschi Mar 6 at 18:43
    
@Gotschi It's almost 100 lines...Are there specific values that are relevant? –  user939259 Mar 6 at 18:49
    
checking my ssh, the authorized_keys file should be in the .ssh subdirectory So since you logged into 1.2.3.4/cloudbox, have a look for ~/.ssh/authorized_keys there, or even authorized_keys2 i've heard of that one too. But look in the .ssh subdirectory list files there –  barlop Nov 2 at 13:55
    
I don't know about ssh-copy-id hanging.. here i'm v unsure but I wonder if it uses a password and that isn't working.. or if there's a verbose mode for it like -v or -vvv or if you try not managing to get the public key and it goes to password so you can check if it manages to log in via password.. maybe you could try starting again with configuring it, so first get password working then keys. –  barlop Nov 2 at 14:01
    
Oh actually I figured it out a while after posting this question. It was a SSH control master session that was running in the background. ssh-copy-id hanging with control master is a known bug –  user939259 Nov 3 at 3:24

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.