Unable to ssh after firstboot

I am facing a weird issue with openwrt barrier breaker version.

I am unable to access my access point after first-boot over the network via ssh.

I found that, after connecting console and press enter key 2-3 times, my ssh starts working.

ping to Access point is working fine but ssh gives following error
: Permission denied (publickey).

Any idea or idea, how can we fix this issue. As connecting console every time won't be possible.

Barrier Breaker is old and unsupported. It also still uses telnet for the first connection after initial flash, if I recall correctly.

2 Likes

Hi Borromini

Actually, i am using dropbear with following config

# cat /etc/config/dropbear 

config dropbear
        option Port '5061'
        option PasswordAuth 'on'

It seems to be expecting you to use a key somehow. Can you share the output of ssh with -v?

Hi Borromini,

Please see "ssh -v" output below:

$ ssh -v -p 5061 admin@172.16.1.8
OpenSSH_8.2p1 Ubuntu-4ubuntu0.2, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 172.16.1.8 [172.16.1.8] port 5061.
debug1: Connection established.
debug1: identity file /home/amitkumar/.ssh/id_rsa type 0
debug1: identity file /home/amitkumar/.ssh/id_rsa-cert type -1
debug1: identity file /home/amitkumar/.ssh/id_dsa type -1
debug1: identity file /home/amitkumar/.ssh/id_dsa-cert type -1
debug1: identity file /home/amitkumar/.ssh/id_ecdsa type -1
debug1: identity file /home/amitkumar/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/amitkumar/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/amitkumar/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/amitkumar/.ssh/id_ed25519 type -1
debug1: identity file /home/amitkumar/.ssh/id_ed25519-cert type -1
debug1: identity file /home/amitkumar/.ssh/id_ed25519_sk type -1
debug1: identity file /home/amitkumar/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/amitkumar/.ssh/id_xmss type -1
debug1: identity file /home/amitkumar/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
debug1: Remote protocol version 2.0, remote software version dropbear_2014.63
debug1: no match: dropbear_2014.63
debug1: Authenticating to 172.16.1.8:5061 as 'admin'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: diffie-hellman-group1-sha1
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha1 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha1 compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:Emt60p219Ntmw3d0MMwt9tuMW0f3Yl98/NtKxTkQytg
debug1: Host '[172.16.1.8]:5061' is known and matches the RSA host key.
debug1: Found key in /home/amitkumar/.ssh/known_hosts:24
debug1: rekey out after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 4294967296 blocks
debug1: Will attempt key: /home/amitkumar/.ssh/id_rsa RSA SHA256:P8r2eR/ksVTTWBSFBYAQXtk3IS+Iec/kp3lJaJR6LLQ agent
debug1: Will attempt key: /home/amitkumar/.ssh/id_dsa 
debug1: Will attempt key: /home/amitkumar/.ssh/id_ecdsa 
debug1: Will attempt key: /home/amitkumar/.ssh/id_ecdsa_sk 
debug1: Will attempt key: /home/amitkumar/.ssh/id_ed25519 
debug1: Will attempt key: /home/amitkumar/.ssh/id_ed25519_sk 
debug1: Will attempt key: /home/amitkumar/.ssh/id_xmss 
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/amitkumar/.ssh/id_rsa RSA SHA256:P8r2eR/ksVTTWBSFBYAQXtk3IS+Iec/kp3lJaJR6LLQ agent
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/amitkumar/.ssh/id_dsa
debug1: Trying private key: /home/amitkumar/.ssh/id_ecdsa
debug1: Trying private key: /home/amitkumar/.ssh/id_ecdsa_sk
debug1: Trying private key: /home/amitkumar/.ssh/id_ed25519
debug1: Trying private key: /home/amitkumar/.ssh/id_ed25519_sk
debug1: Trying private key: /home/amitkumar/.ssh/id_xmss
debug1: No more authentication methods to try.
admin@172.16.1.8: Permission denied (publickey).

After connecting console wire and pressing 2-3 times enter-key. the problem gets resolved.

But it's not practically possible to open each box and connect the console.

Can you suggest, what's went wrong with my version of code.

Thanks in advance

Try using -o PubKeyAuthentication=no with ssh, see how that works out.

tried this already, same output

$ ssh -p 5061 -o PubKeyAuthentication=no admin@172.16.1.8
admin@172.16.1.8: Permission denied (publickey).

Out of ideas, sorry.

Hi Folks,

Meanwhile, i have found following from console logs:

Tue Apr 13 05:51:27 2021 authpriv.info dropbear[3128]: Early exit: Terminated by signal
Tue Apr 13 05:51:27 2021 authpriv.info dropbear[7017]: Not backgrounding

Run it manually, and see logs afterwards:
/etc/init.d/dropbear start; logread -f