Nerdy Drunk

Drunk on technology

User Tools

Site Tools


hpe:switch-ssh-scp-key-auth

HPE Switch SSH SCP Key Authentication

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.

<SWITCH01>_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.
<SWITCH01>

configure ssh key for user

<SWITCH01>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
hpe/switch-ssh-scp-key-auth.txt · Last modified: 2022/07/21 10:41 by 127.0.0.1