authcha learn

Learn / Foundations

Your first two-factor device login

Module 5 of 6 · 35 minutes

By the end you can

  • Register a network device and its RADIUS client with the right secret
  • Create a user and map their type to privileges on that vendor
  • Prove the setup with the Auth Simulator before touching the device
  • Configure a Cisco, Juniper, Arista, MikroTik or FortiGate device and sign in with a code

The plan

You will go from an empty console to a working two-factor login on one real device, in eight steps. Follow them in order. The same checklist is in the console as Guided Setup, which ticks off each step for you.

You need: an installed Authcha, a delivery provider for codes (WhatsApp or SMS, under Integrations → OTP Delivery; the delivery channels guide shows how to send codes by other routes), and one network device you can configure.

Step 1. Register the device

Go to Devices → Add device.

FieldWhat to enter
IP addressThe address the device sends RADIUS from. It must match the NAS-IP-Address in its requests. Use the RADIUS source interface you configure on the device; a loopback is best.
Device typeThe vendor profile, such as ios, iosxe, junos, arista, mikrotik or fortinet
HostnameOptional. Shown in logs and reports
Auth flowLeave on Inherit for now. The next module explains the choices

You can import many devices at once from a CSV on the Devices page. Each registered device counts against the device cap in your license, if there is one.

Step 2. Add its RADIUS client

Go to Authorization Policies → RADIUS Clients → Add client. Enter the device's IP address (or a CIDR range that covers several devices with the same secret), a short name, and a long random shared secret. Use a different secret per device or per site.

FreeRADIUS reads its clients only at start, so the console applies your change by restarting the RADIUS service a few seconds after the last edit. The clients page shows Applying…, then Applied. The restart is brief and devices simply retry. Deleted clients are no longer loaded.

Step 3 (optional). Define jump servers

Only if engineers connect through bastion hosts, or you want to limit where logins may come from. For each one, enter its IP address, the base user type it accepts and the effective user type users get from it. A login from a source with no matching rule is refused only when jump servers are set to Required. If you have no bastion hosts, skip this step.

Step 4. Create a user

Go to Users → Add user. The password is generated and shown once; pass it on securely. Enter the mobile number that will receive codes, and the user type, such as human-write. A user with no mobile number cannot complete a code login, unless the device is set to password-only.

Step 5. Check the privilege mapping

Go to Authorization Policies → Privilege Mapping. Authcha ships presets for 35 vendors and mappings for the four seeded user types on the common ones. Look at the row for your device type and your user type. Change the group or edit its reply attributes if your privilege model differs. Changes apply to the next login with no restart.

To add a vendor with no preset, register the device with a new device type name, create privilege groups with that vendor's attributes, and map each user type to a group.

Step 6. Test with Try It

Before touching the real device, open Try It → Auth Simulator (also at Auth Simulator on the demo). Enter the username, the device IP and the source IP. It runs the same four steps as a real login (user and device, jump server rule, effective user type, privilege mapping) and shows the verdict and the exact reply attributes the device would receive. It never sends a code.

Then open Try It → OTP Delivery and send a real test code to a mobile number. This proves your provider works end to end.

If the simulator accepts the login and the code arrives, you are ready.

Step 7. Configure the device

Point it at Authcha's address, with the shared secret from step 2, sending RADIUS from the interface whose address you registered in step 1.

Cisco IOS and IOS-XE:

aaa new-model
radius server AUTHCHA
 address ipv4 192.0.2.10 auth-port 1812 acct-port 1813
 timeout 10
 retransmit 1
 key <shared-secret>
aaa group server radius AUTHCHA-GRP
 server name AUTHCHA
 ip radius source-interface Loopback0
aaa authentication login default group AUTHCHA-GRP local
aaa authorization exec default group AUTHCHA-GRP local if-authenticated
aaa accounting exec default start-stop group AUTHCHA-GRP
line vty 0 15
 login authentication default
 authorization exec default

Keep local in the list so you can still reach the device if Authcha is unreachable. Junos, Arista EOS, MikroTik RouterOS and FortiGate have their own short recipes in the Getting started guide. Every vendor needs the same three things: the server address, the shared secret and a source address that matches the device you registered.

Step 8. Log in for real

  1. SSH to the device (from a jump server if you use them).
  2. Enter the username and password.
  3. Enter the code that arrives by WhatsApp or SMS.

Watch it happen in Live Auth → Logs. Afterwards, find it in Audit Trail → Auth History, and the code delivery in Audit Trail → OTP Funnel. If the login is refused, the Troubleshooting guide walks through the device-login causes.

LabHands-on

Steps 1 to 4 work on the demo as demo-viewer (password Authcha-View-2026). Steps 5 to 9 need your own install and a device or a lab VM.

  1. Open Devices on the demo and find a Cisco device. Note its device type and IP address.
  2. Open the Auth Simulator and enter a demo username, that device's IP and a source IP. Read the verdict and the reply attributes.
  3. Open Live Auth and find a recent accepted login. Open its detail.
  4. Open Users and find the user from the log entry. What is their user type?
  5. On your install, register a device and its RADIUS client with a new long secret. Wait for the clients page to show Applied.
  6. Create a user with a mobile number and the human-write type.
  7. Run the simulator for that user and device. You should see an accept and the privilege attributes.
  8. Send a test code from Try It → OTP Delivery.
  9. Configure the device and sign in. Find your login in Live Auth and in Auth History.

Check yourselfQuiz

1Which address must you register for a device?
2You added a RADIUS client. How does FreeRADIUS pick it up?
3What does the Auth Simulator do that makes it safe to use on a production system?
4Why set the device's RADIUS timeout to at least 10 seconds?
5Where do you see a login as it happens?

Cheat sheetKeep this

  1. Devices → Add device (IP, device type)
  2. Authorization Policies → RADIUS Clients (address, long secret), wait for Applied
  3. Jump servers (optional)
  4. Users → Add user (mobile number, user type)
  5. Privilege Mapping (review per vendor)
  6. Try It → Auth Simulator, then OTP Delivery test
  7. Configure the device: server, secret, source interface, timeout of 10 s or more, local fallback
  8. Sign in, then check Live Auth, Auth History, OTP Funnel
  9. Read more: Getting started.