· 6 years ago · Oct 31, 2018, 07:22 AM
1cd .ssh
2openssl genrsa -des3 -out id_rsa
3openssl rsa -in id_rsa -out id_rsa
4ssh-keygen -y -f id_rsa > authorized_keys
5
6$ ssh -v -i ~/.ssh/id_rsa root@192.168.1.1
7OpenSSH_7.4p1, OpenSSL 1.0.2j 26 Sep 2016
8debug1: Reading configuration data /etc/ssh/ssh_config
9debug1: Connecting to 192.168.1.1 [192.168.1.1] port 22.
10debug1: Connection established.
11debug1: key_load_public: No such file or directory
12debug1: identity file /home/chazy/.ssh/id_rsa type -1
13debug1: key_load_public: No such file or directory
14debug1: identity file /home/chazy/.ssh/id_rsa-cert type -1
15debug1: Enabling compatibility mode for protocol 2.0
16debug1: Local version string SSH-2.0-OpenSSH_7.4
17debug1: Remote protocol version 2.0, remote software version dropbear
18debug1: no match: dropbear
19debug1: Authenticating to 192.168.1.1:22 as 'root'
20debug1: SSH2_MSG_KEXINIT sent
21debug1: SSH2_MSG_KEXINIT received
22debug1: kex: algorithm: curve25519-sha256@libssh.org
23debug1: kex: host key algorithm: ssh-rsa
24debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha1 compression: none
25debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha1 compression: none
26debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
27debug1: Server host key: ssh-rsa SHA256:1EFA75uwLp+4hBW0t3aaY05QjLzYd4jjDWoULAzF/8o
28debug1: Host '192.168.1.1' is known and matches the RSA host key.
29debug1: Found key in /home/chazy/.ssh/known_hosts:1
30debug1: rekey after 4294967296 blocks
31debug1: SSH2_MSG_NEWKEYS sent
32debug1: expecting SSH2_MSG_NEWKEYS
33debug1: SSH2_MSG_NEWKEYS received
34debug1: rekey after 4294967296 blocks
35debug1: SSH2_MSG_SERVICE_ACCEPT received
36debug1: Authentications that can continue: publickey
37debug1: Next authentication method: publickey
38debug1: Trying private key: /home/chazy/.ssh/id_rsa
39debug1: Authentications that can continue: publickey
40debug1: No more authentication methods to try.
41Permission denied (publickey).
42
43dropbearconvert openssh dropbear id_rsa id_rsa.db
44
45# Comments allowed at start of line
46 ssh-rsa AAAAB3Nza...LiPk== user@example.net
47 from="*.sales.example.net,!pc.sales.example.net" ssh-rsa
48 AAAAB2...19Q== john@example.net
49
50NOTES
51 The program dropbearconvert(1) can be used to convert between Dropbear
52 and OpenSSH key formats.
53
54 Dropbear does not support encrypted keys.
55
56EXAMPLE
57 generate a host-key:
58 # dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
59
60 extract a public key suitable for authorized_keys from private key:
61 # dropbearkey -y -f id_rsa | grep "^ssh-rsa " >> authorized_keys