silversid wrote:Hi all,
how can I configure a Cisco router to ask for a username and password when connecting to it with telnet or ssh?
@silversid
There are a few ways to configure this, the one method is to create a local database with usernames and password that can be used to allow access to the device, the other method used primarily in larger networks is to implement a database solution that will keep track of the usernames and passwords of the users and just have the Cisco devices point to that database. For the central control Cisco has an application called ACS which you can create all the usernames and passwords in, or even point it to your domain repository like Windows Active Directory.
I'll assume you are looking for the quicker local login access which you can configure like this.
conf t
username Jay privilege 15 password ccna
username silversid privilege 15 password ccna
{The above two commands will create a username for you and me with our passwords been set to 'ccna'}
We then need to tell the Cisco router that we wish to use the local database for login permissions, this needs to be set on the lines (vty/ssh)
line vty 0 4
login local
you can also configure this to be used on the console connections as well
line console 0
login local