To avoid the string of comments: Yes, this is insecure (not even arguably insecure). I would strongly recommend you only do it in a lab situation on an isolated network or a similiar situation that does not involve production servers or potentientially production server without a full reset/format.
I wanted to set this up as I don't think my 2950 switch supports private/public keys and I hope at some point to get that knowledge, but I am not there yet.
Using an alias and sshpass this can be accomplished.
- Install sshpass
- Alter your .ssh/config file to include the username as listed in the question
- Add an alias to your terminal (I used .bashrc and would recommend against gloabl settings)
- Use alias to log into the target
My example alias is:
alias ssc='sshpass -pcisco ssh'
Where "cisco" is the password. Note there is no space between the -p and the password.
Usage is (referencing the question):
Note: This answers the question in title only for those using search engines. If you are using servers like the question example, private/public key pairs and not this answer should be used