We first start of with creating the users using the following command:
username user password password
We use this command for each user we want to create.
Now we enable the use of usernames to login to the router.
We use to following commands:
aaa new-model
aaa authentication login default local
The first line enables aaa or authentication, authorization and accounting. The second line is telling the router to use the local user database which was created in the first step.
Now that this is enabled on the router logging into the router (console, telnet) will prompt for a username/password.
source: .tech-recipes