SOLVED Getting shell SSH to use key

badincite

Dabbler
Joined
Aug 10, 2022
Messages
20
Trying to setup SSH to use this key to get into my esxi server. I've added the public key in the authorized_keys of esxi I cant seem to get the shell console to use the key. Anything else I need to do its still asking for the password everytime?

Current Setup
1660432046453.png


1660432072980.png



1660433065515.png


1660433103890.png
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
've added the public key in the authorized_keys of esxi
Which public key have you added? What you showed in your screen shot is the host's public key, not a user's public key.
 

badincite

Dabbler
Joined
Aug 10, 2022
Messages
20
Which public key have you added? What you showed in your screen shot is the host's public key, not a user's public key.
The public one from the keypair. I did get the ssh key working with putty so I know I set it up right on the esxi side.

1660435932985.png
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
The SSH Keypairs are only used in 1) SSH Connections for ZFS replication; and 2) in Cloud Credentials for SFTP with rclone. For shell SSH, you have to do things the old-fashioned way in CLI, with files in root's ~/.ssh directory.
 

badincite

Dabbler
Joined
Aug 10, 2022
Messages
20
The SSH Keypairs are only used in 1) SSH Connections for ZFS replication; and 2) in Cloud Credentials for SFTP with rclone. For shell SSH, you have to do things the old-fashioned way in CLI, with files in root's ~/.ssh directory.
Thanks hopefully it works this time.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
@badincite, think of it this way. Anything set in the UI is for the UI's consumption. The Shell is a separate universe, and is deprecated as much as possible, as configuration changes in the Shell aren't sync'ed to the UI's middleware database, unless you're using the midclt command or the Console menu /etc/netcli.sh. Likewise, the Shell has no knowledge of the configuration database, which will overwrite manual file edits on the next boot.

Root's home directory is specifically exempted from this stomping on next boot by the configuration database, so any manual ~/.ssh files should be left alone.
 

badincite

Dabbler
Joined
Aug 10, 2022
Messages
20
@badincite, think of it this way. Anything set in the UI is for the UI's consumption. The Shell is a separate universe, and is deprecated as much as possible, as configuration changes in the Shell aren't sync'ed to the UI's middleware database, unless you're using the midclt command or the Console menu /etc/netcli.sh. Likewise, the Shell has no knowledge of the configuration database, which will overwrite manual file edits on the next boot.

Root's home directory is specifically exempted from this stomping on next boot by the configuration database, so any manual ~/.ssh files should be left alone.

How do I tell the ssh client to use the key? I grabbed the esxi.pub key and entered it into the authorized keys still asking for a password in the TrueNAS ssh client trying to get to the esxi server.

1660479018692.png


1660479180597.png
 
Top