SaveMyCert
Log in
5 of 5 free questions left today·for 10 a day
Network Services and Security

CCNA AAA and Secure File Transfer: Local Users, TACACS+, RADIUS, SCP and SFTP

14 min readCCNA · Network Services and SecurityUpdated

<p>Management access control is how a network device decides who may log in to manage it, what each administrator may do, and how their activity is recorded, using local usernames or an AAA server reached over TACACS+ or RADIUS. This lesson covers CCNA 200-301 v2.0 exam topics 4.1 and 4.2: local accounts and VTY login, <code>aaa new-model</code>, default and named method lists, fallback behaviour, TACACS+ versus RADIUS, server and source-interface configuration, exec authorization and accounting, and moving configuration and image files securely with SCP and SFTP.</p>

What you’ll learn
  • Create local accounts with hashed secrets and the right privilege level, and secure every VTY line with login local and SSH-only transport
  • Explain what aaa new-model changes and apply default and named authentication method lists to lines
  • Predict when a method list falls back to the next server or to local accounts, and when a login is simply rejected
  • Compare TACACS+ and RADIUS by transport, ports, encryption and separation of authentication, authorization and accounting
  • Configure TACACS+ and RADIUS servers, server groups, ports and source interfaces on IOS XE
  • Use exec and command authorization and exec and command accounting for management sessions
  • Transfer, verify and apply configuration and image files with SCP and SFTP, and choose between merging and replacing a configuration

How do you create local user accounts on a Cisco device?

Create them with username NAME privilege LEVEL secret PASSWORD. The secret keyword stores a one-way hash, and the privilege keyword sets the level the user is given at login (1 = user EXEC >, 15 = privileged EXEC #). Local accounts are the whole login database on a device without AAA, and the fallback (break-glass) database on a device that uses AAA servers.

FormHow it is storedCan someone who reads the config recover it?
username ops secret … (type 5 MD5, type 8 PBKDF2-SHA-256, type 9 scrypt)One-way hashNo. Prefer algorithm-type scrypt (type 9) or sha256 (type 8, PBKDF2 with SHA-256) where the platform offers it
username ops password 0 …Clear textYes, it is readable as typed
username ops password 7 …Type 7, a weak reversible encodingYes. Type 7 strings can be decoded with freely available tools

service password-encryption only turns clear-text password entries into type 7. It hides passwords from someone glancing over your shoulder; it does not make them a hash. The fix for a reversible password entry is to re-create the account with secret and a new credential (the old one has been exposed). The enable secret protects the enable command only; changing it does nothing for a username's stored password.

username netops privilege 15 algorithm-type scrypt secret Long-Passphrase-1
username noc-viewer privilege 1 secret Long-Passphrase-2

How do VTY lines use local accounts without AAA?

Without AAA, the line itself decides how logins are checked: login local prompts for a username and checks the local username database, while plain login asks only for the shared line password. Which protocols may connect is a separate setting, transport input.

Line commandEffect
login + password …One shared line password, no username, no individual accountability
login localUsername and password checked against local accounts
transport input sshOnly SSH may connect inbound; Telnet is refused
transport input telnet sshBoth are accepted, so Telnet is still open
transport output …Controls sessions the user opens from the device, not connections to it

Configure every VTY range. Many switches have line vty 0 4 and line vty 5 15 as separate blocks; securing only 0–4 leaves the remaining lines on the old password and Telnet. Using line vty 0 15 sets lines 0 to 15 at once; check show line in case the platform has further VTY lines beyond 15. SSH itself also needs a hostname, a domain name and RSA keys of an adequate size, and best practice adds ip ssh version 2 so only SSHv2 is accepted; SSH setup is covered in the device-management lessons, and filtering which source addresses may reach the VTY lines belongs to the ACL lesson.

line vty 0 15
 login local
 transport input ssh

What does aaa new-model change?

aaa new-model turns on the AAA framework; until it is entered, IOS rejects every other aaa command, including aaa authentication, aaa authorization, aaa accounting and aaa group server. It also changes how lines authenticate immediately: login, login local and line passwords stop being used, and each line is checked by an AAA method list instead.

  • A line with no list applied uses the default list.
  • If no default list has been defined yet, VTY (remote) logins are checked against the local username database.
  • The console is the exception: with no default list and no named list applied to line con 0, console login succeeds without any authentication check. Defining a default list, or applying a named list to the console, closes that gap.

The practical consequence: the moment you type aaa new-model on a remote device, the next Telnet or SSH login asks for a username, and the old VTY password no longer works. Create a local privileged account before enabling AAA on a device you reach remotely, or you can lock yourself out. Server definitions (tacacs server, radius server) and the domain name are independent of AAA and can be entered in any order; every command that starts with aaa, server groups included, needs aaa new-model first.

How do default and named method lists work?

A method list is an ordered list of ways to check a login, for example aaa authentication login default group tacacs+ local. The default list applies automatically to every line that has no other list; a named list does nothing until you apply it to a line with login authentication NAME.

aaa new-model
aaa authentication login default group tacacs+ local
aaa authentication login LOCAL-ONLY local
!
line con 0
 login authentication LOCAL-ONLY
line vty 0 15
 transport input ssh

Here the VTY lines use the default list (TACACS+, then local), while the console uses only local accounts, so engineers at the console never wait for server timeouts during a WAN outage. To give one line different behaviour, define a named list and apply it to that line; changing the default list would change every line at once.

Method keywordWhat it checks
group tacacs+Every configured TACACS+ server, in configuration order
group radiusEvery configured RADIUS server, in configuration order
group NAMEOnly the servers listed in that server group
localThe device's username database
enableThe enable secret (no username)
lineThe line password (no username)
noneNo authentication at all; avoid

A common mistake is defining a named list for SSH and never applying it under line vty: the lines keep using the default list (or, for VTY lines, the local database if there is none), and the AAA server sees no requests.

When does a method list fall back to the next method?

The device moves to the next server or method only when there is no answer (an error: timeout, unreachable server). If a server answers with a reject (a fail), the login is denied and nothing further in the list is tried.

What happens with group MGMT-AAA localResult
First server times out, second server acceptsLogin succeeds via the second server (within a group, servers are tried in order on timeout)
A server answers with a reject (unknown user, disabled account, wrong password)Login denied, even if the user has a valid local account
Every server in the group is silentThe device moves on to local

This is why the order matters. Listing the server group before local makes local accounts a pure outage fallback: while any server answers, local credentials do not work. Putting local first reverses that, so a valid local account always works and the servers are consulted only for users the local database cannot check. Using line or enable as the last method still lets admins in during an outage, but with a shared password and no username.

The same rule explains a group that contains a dead server: with group tacacs+, every defined TACACS+ server is tried in order, so a powered-off lab server adds a timeout to every login. Build a server group that lists only the production servers and reference it with group NAME.

What is the difference between TACACS+ and RADIUS?

Both are AAA protocols a network device uses as a client of a central server, but TACACS+ is built for device administration and RADIUS for network access. The differences the CCNA expects you to know:

TACACS+RADIUS
Transport and portsTCP 49UDP 1812 (authentication) and 1813 (accounting); older implementations use 1645/1646
What is encryptedThe entire packet body (username, attributes, commands)Only the password in the Access-Request
A, A and ASeparated: authentication, authorization and accounting are independent exchangesAuthentication and authorization combined: the Access-Accept carries the user's attributes
Per-command authorizationYes, each command can be checked against policy before it runsNo per-command exchange
Origin and typical useCisco-developed (now documented in RFC 8907); administrator logins to routers and switchesOpen IETF standard; user network access such as 802.1X, VPN and Wi-Fi

The underlying facts drive every design choice: because TACACS+ obfuscates the whole body, a packet capture shows nothing but the header; because it runs authorization as its own exchange, policy can be checked command by command after login. RADIUS exposes usernames and attributes on the wire and ties authorization to the authentication reply, but it is the vendor-neutral standard that switches, wireless controllers and VPN gateways all speak for end-user access.

How do you configure a device as a TACACS+ or RADIUS client?

Define each server with its address and shared key, optionally group the servers, then point a method list at them. Modern IOS XE uses named server blocks:

aaa new-model
tacacs server TAC-A
 address ipv4 172.16.20.11
 key Shared-Key-T
tacacs server TAC-B
 address ipv4 172.16.21.11
 key Shared-Key-T
aaa group server tacacs+ MGMT-AAA
 server name TAC-A
 server name TAC-B
!
radius server NPS-A
 address ipv4 172.16.20.31 auth-port 1812 acct-port 1813
 key Shared-Key-R
aaa group server radius RADIUS-MGMT
 server name NPS-A
!
aaa authentication login default group MGMT-AAA local
ip tacacs source-interface Loopback0
  • Ports must match the server. A RADIUS entry pointing at 1645/1646 when the server listens only on 1812/1813 means the server never sees a packet; the device times out and falls back to local. If the server logs nothing at all, check address and ports before the key.
  • The shared key must match on both sides. RADIUS uses it to hide the password; TACACS+ uses it to encrypt the whole body.
  • The source address must match how the server knows the device. A server registers each network device by IP address. By default the request leaves from the outgoing interface, so if the server has the device registered by its Loopback0 address, set ip tacacs source-interface Loopback0 and/or ip radius source-interface Loopback0. Each protocol has its own source-interface command, and each one changes only its own traffic.

Verify with show tacacs, show aaa servers and test aaa group …, and use debug aaa authentication to see which method answered.

How do AAA authorization and accounting control management sessions?

Authorization decides what an authenticated user may do; accounting records what they did. Neither happens unless you configure it.

CommandWhat it does
aaa authorization exec default group tacacs+ localAt login, asks the server (or local database) for the user's EXEC attributes, including privilege level, and applies them
aaa authorization commands 15 default group tacacs+ localChecks each level-15 command against policy before it runs (approval, not logging)
aaa accounting exec default start-stop group tacacs+Sends a record when a management session starts and another when it ends (session time, who is logged in now)
aaa accounting commands 15 default start-stop group tacacs+Sends every level-15 command with username and time (audit trail)
aaa accounting system … / network …System events (such as reloads) / network-service sessions such as PPP, not admin logins

Why admins land at >. With aaa new-model, authentication alone starts the session at level 1. The privilege level stored on a local account (username netops privilege 15) or returned by the TACACS+ server is applied only when aaa authorization exec is configured for that source. A privilege level set on the line itself applies one level to every user of that line, so it cannot give different administrators different levels.

start-stop sends both records; stop-only sends only the end record, so open sessions are not visible live. Command authorization applies to the console only when aaa authorization console is configured.

How do you transfer files securely with SCP and SFTP?

SCP (Secure Copy) and SFTP (SSH File Transfer Protocol) both run over SSH on TCP port 22, so the user is authenticated and the credentials and file contents are encrypted. TFTP (UDP 69, no authentication), FTP (TCP 21, credentials and data in clear text) and HTTP send everything readable. When replacing TFTP backups with SCP, the firewall must allow TCP 22 to the server.

The device as a client. When you run copy on the router or switch, it is the client; no server feature on the device is needed, and the user in the URL is an account on the remote server. The syntax is always copy SOURCE DESTINATION:

copy running-config scp://netbackup@172.16.40.10/EDGE-RTR-01.cfg
copy sftp://imgadmin@172.16.40.12//firmware/new-image.bin flash:
copy flash:EDGE-RTR-01-old.cfg sftp://imgadmin@172.16.40.12//archive/
  • Back up running-config when unsaved changes must be included; startup-config is only what was last saved.
  • SCP and SFTP copies leave from the address set by ip ssh source-interface. If a firewall or server only accepts the device's loopback, set that command; the source-interface settings of other protocols do not apply to SSH-based copies.
  • IOS XE supports SFTP as a client only; a remote host cannot push files into the device with SFTP.

The device as an SCP server. For a laptop or backup server to push or pull files with scp, the device needs:

  1. a working SSH server (keys, ip ssh version 2);
  2. ip scp server enable (off by default; SSH working is not enough);
  3. AAA authentication and aaa authorization exec;
  4. a user who reaches privilege level 15.

SCP needs no line transport of its own: it arrives over SSH, so a line that accepts SSH already accepts it. One recent trap: OpenSSH 9.0 and later make the scp command use the SFTP protocol underneath by default. Because IOS XE does not accept inbound SFTP, the login succeeds and the transfer then closes. scp -O forces the legacy SCP protocol and the copy works again.

How do you verify images and replace configurations?

Verify a copied software image with verify /md5 flash:FILE before setting it as the boot image: it computes the file's MD5 hash so you can compare it with the value published on Cisco's software download page (you can also append the expected hash and IOS reports whether it matches). File listings show size and date, and version output describes the image that is running now; only a hash proves the new file's contents are intact.

verify /md5 flash:new-image.bin

For configuration files, the key distinction is merge versus replace:

CommandEffect on the running configuration
copy FILE running-configMerges: commands in the file are applied on top; anything not in the file (old routes, ACLs) stays
configure replace FILEReplaces: the running configuration becomes exactly the file, removing and adding lines as needed, with no reload
copy FILE startup-config + reloadThe file becomes the configuration only after a restart (an outage)

To roll back a change, save a copy first (copy running-config flash:baseline-0915.cfg) and later run configure replace flash:baseline-0915.cfg. Be careful with the startup configuration as a rollback point: if anyone saved during the change, it now holds the changed configuration, not the one from before. The source of a replace can be a local file or a remote URL such as scp://.

Tip. Questions on this topic are mostly scenarios with a configuration excerpt or a symptom: a login that is slow, falls back to local accounts or lands at the wrong prompt, an AAA server that logs nothing or logs an unknown device, or a file transfer that fails. You are asked for the cause, the missing command or the change that meets a stated constraint, such as keeping some users at a lower privilege level, not touching the server, avoiding a reload or allowing local logins only during an outage. Expect to read method lists and predict who can log in, to tell default lists from named ones, error from fail, authorization from accounting and exec from commands, to match TACACS+ and RADIUS to ports and encryption, to know which source-interface command applies to which traffic, and to choose between merge and replace for configuration files. Some items ask you to select two answers.

Key takeaways
  • username NAME privilege 15 secret stores a one-way hash; password 0 is clear text and password 7 (including service password-encryption) is reversible.
  • Without AAA, login local checks local accounts and transport input ssh refuses Telnet; apply both to every VTY range.
  • aaa new-model must come before every aaa command, server groups included; after it, lines use the default list, VTY lines fall back to the local database if no default list exists, and the console is not authenticated at all until a list covers it.
  • The default list applies automatically; a named list works only where login authentication NAME is applied.
  • Fallback happens on silence (error), never on a reject (fail): group SERVERS local uses local accounts only when no server answers.
  • group tacacs+ means every TACACS+ server; group NAME means only that group's members.
  • TACACS+ is TCP 49, encrypts the whole body and separates authorization (per-command); RADIUS is UDP 1812/1813, encrypts only the password and combines authentication with authorization.
  • Privilege levels from local accounts or the server are applied only with aaa authorization exec; accounting exec logs sessions, accounting commands logs commands.
  • ip tacacs, ip radius and ip ssh source-interface are separate commands; the source must match what the server or firewall expects.
  • SCP and SFTP use SSH on TCP 22; IOS as an SCP server needs ip scp server enable, exec authorization and a privilege 15 user; copy to running-config merges, configure replace replaces.

Frequently asked questions

What is the difference between username secret and username password on Cisco IOS?

username secret stores a one-way hash of the password (MD5, PBKDF2-SHA-256 or scrypt depending on the type), so it cannot be recovered from the configuration. username password stores the password in clear text or, with service password-encryption, as reversible type 7, which anyone can decode. Use secret for every account.

What does aaa new-model do on a Cisco router or switch?

aaa new-model enables the AAA framework. Until it is configured, IOS rejects every other aaa command, including aaa authentication, authorization, accounting and aaa group server. Once it is on, line passwords and login local stop being used; each line authenticates with an AAA method list. Lines with no list use the default list; if no default list exists, VTY logins use the local username database, while the console is not authenticated at all until a default list or an applied named list covers it.

Does a Cisco device fall back to local accounts if the TACACS+ server rejects a user?

No. With a list such as group tacacs+ local, the device tries local accounts only when no TACACS+ server answers. If a server responds with a reject, for example because the user is unknown or disabled, the login is denied and the local database is not checked.

What are the main differences between TACACS+ and RADIUS?

TACACS+ uses TCP port 49, encrypts the entire packet body and handles authentication, authorization and accounting separately, which allows per-command authorization, so it suits administrator access to network devices. RADIUS uses UDP ports 1812 and 1813 (legacy 1645 and 1646), encrypts only the password and combines authentication with authorization, and is the open standard for user network access such as 802.1X and VPN.

Why does an administrator with privilege 15 land at the > prompt after logging in with AAA?

With aaa new-model, authentication alone starts the session at privilege level 1. The privilege level stored on the local account or returned by the TACACS+ server is applied only when aaa authorization exec is configured, for example aaa authorization exec default group tacacs+ local.

How do you enable SCP on a Cisco IOS device?

For the device to accept scp transfers, configure SSH, then ip scp server enable, AAA authentication and aaa authorization exec, and use an account that reaches privilege level 15. When the device itself runs copy to or from an scp:// or sftp:// URL it is the client, and none of the server settings are needed.

Why does scp from a new laptop fail against Cisco IOS XE with Connection closed?

OpenSSH 9.0 and later make the scp command use the SFTP protocol by default, and IOS XE does not accept inbound SFTP sessions. Authentication succeeds and the session then closes. Running scp -O forces the legacy SCP protocol, which IOS XE supports.

What is the difference between copy to running-config and configure replace?

copy FILE running-config merges the file into the running configuration, so lines that exist only in the running configuration remain. configure replace FILE makes the running configuration identical to the file, removing lines that are not in it, without a reload, which makes it the right tool for an exact rollback.

Source

This lesson covers the "Network Services and Security" domain of the official CCNA exam guide. Vendors revise their guides — check the source for the current version.

Test yourself on this topic
Practice now

Sign up free to mark lessons complete, bookmark topics and track your exam readiness.

Spotted a mistake in this lesson?