==== HPE Switch SSH SCP Key Authentication ====
{{tag>General HPE ssh-key-auth}}
This was configured on an HP v1910 switch.
enable ssh and sftp
scp public key to switch
[USER01@HOST01 ~]$ scp .ssh/id_rsa.pub SWITCH01:USER01-HOST01.key
enable super secret hidden command mode with password 512900\\
Based on my experience you must use the default "admin" user to access this.
_cmdline-mode on
All commands can be displayed and executed. Continue? [Y/N]y
Please input password:******
Warning: Now you enter an all-command mode for developer's testing, some commands may affect operation by wrong use, please carefully use it with our engineer's direction.
configure ssh key for user
system-view
System View: return to User View with Ctrl+Z.
[SWITCH01]public-key peer USER01-HOST01 import sshkey flash:/USER01-HOST01.key
[SWITCH01]ssh user USER01 service-type all authentication-type any assign publickey USER01-HOST01 work-directory flash:/
backup startup config via scp with key authentication
[USER01@HOST01 ~]$ scp SWITCH01:startup.cfg ./SWITCH01.startup.cfg-DATE.txt
if you want to ssh with key authentication as a super user instead of having to use password authentication do the following. please keep in mind that ALL key authentication users will obtain super user access even if they are not configured as a super user.
[SWITCH01]user-interface vty 0 15
[SWITCH01-ui-vty0-15]user privilege level 3