For this quick example for enabling SSH Server on S5800 (HP 5800) series switches. This might work for other switches in other series too.
To start with you need to generate RSA keys for your switch. To do so you need to public-key command with the parameter. This will be used for the encryption key used in the SSH Tunnel.
public-key local create rsa
Next is to enable the SSH server.
ssh server enable
You will need a VTY interface for access on SSH connections. Below are the commands to enable that protocol for AAA.
user-interface vty 0 4
protocol inbound ssh
By default users are given access level of 0 which allows for basic trouble shooting. For this you can edit the default group system but for this example will be creating a new group. Using authorization attribute level at 3 we will be granting any user in this group full access.
authorization-attribute level 3
Last part is create the user pointing that to our newly created group.
password simple mypassword
From there you can test your SSH connection from putty or other such tools.