Make your Apple ID more secure from iPhone
Two-factor authentication ensures that only you can access your Apple ID account, even if someone else knows your Apple ID password. Two-factor authentication is built into iOS 9 and later, and OS X 10.11 and later.
For information about how two-factor authentication works, see the Apple Support article Two-factor authentication for Apple ID.
Note: If you use two-step verification and upgrade to iOS 11 or later, your account might be migrated to use two-factor authentication. See the Apple Support article Switch from two-step verification to two-factor authentication.
Turn on two-factor authentication
Go to Settings > [your name] > Password & Security.
Tap Turn On Two-Factor Authentication, then tap Continue.
Enter a trusted phone number, a phone number where you want to receive verification codes for two-factor authentication (it can be the number for your iPhone).
You can choose to receive the codes by text message or automated phone call.
Enter the verification code sent to your trusted phone number.
To send or resend a verification code, tap “Didn’t get a verification code?”
You won’t be asked for a verification code again on your iPhone unless you sign out completely, erase your iPhone, sign in to your Apple ID account page in Safari, or need to change your Apple ID password for security reasons.
Certain features in the latest version of iOS require the security of two-factor authentication, which is designed to protect your information. After you turn on two-factor authentication, you have a two-week period during which you can unenroll. After that period, you can’t turn off two-factor authentication. To unenroll, open your enrollment confirmation email and click the link to return to your previous security settings. Keep in mind that unenrolling makes your account less secure and means you can’t use features that require a higher level of security.
Add another iOS device (iOS 9 or later) or a Mac (OS X 10.11 or later) as a trusted device
After you turn on two-factor authentication on one device, use the same Apple ID to sign in to iCloud on another device.
Even if you’ve already signed in, sign in again. (On an iOS device, go to Settings > [your name]. On a Mac, choose Apple menu > System Preferences > iCloud.)
When you’re asked enter a six-digit verification code, do one of the following:
Obtain the verification code on your iPhone or another trusted device that’s connected to the Internet: Look for a notification on that device, then tap or click Allow to make the code appear on that device. (A trusted device is another iOS device or Mac on which you’ve already turned on two-factor authentication and which is signed into iCloud with your Apple ID.)
Obtain the verification at a trusted phone number: If a trusted device isn’t available, tap “Didn’t get a verification code?” then choose a phone number.
Obtain the verification code on a trusted device that’s offline: On a trusted iOS device, go to Settings > [your name] > Password & Security, then tap Get Verification Code. On a trusted Mac, choose Apple menu > System Preferences > iCloud > Account Details > Security, then click Get Verification Code.
Enter the verification code on the new device.
You won’t be asked for a verification code again unless you sign out completely, erase your device, sign in to your Apple ID account page in Safari, or need to change your Apple ID password for security reasons.
Add or remove a trusted phone number
When you enrolled in two-factor authentication, you had to verify one trusted phone number. You should also consider adding other phone numbers you can access, such as a home phone, or a number used by a family member or close friend.
Go to Settings > [your name] > Password & Security.
Tap Edit (above the list of trusted phone numbers), then do one of the following:
Add a number: Tap Add a Trusted Phone Number.
Remove a number: Tap next to the phone number.
Trusted phone numbers don’t automatically receive verification codes. If you can’t access any trusted devices when setting up a new device for two-factor authentication, tap “Didn’t get a verification code?” on the new device, then choose one of your trusted phone numbers to receive the verification code.
View or remove trusted devices
Go to Settings > [your name].
A list of the devices associated with your Apple ID appears near the bottom of the screen.
To see if a listed device is trusted, tap it, then look for “This device is trusted and can receive Apple ID verification codes.”
To remove a device, tap it, then tap Remove from Account.
Generate a password for an app that signs in to your Apple ID account
With two-factor authentication, you need an app-specific password to sign in to your Apple ID account from a third-party app or service—such as an email, contacts, or calendar app. After you generate the app-specific password, use it to sign in to your Apple ID account from the app and access the information you store in iCloud.
Sign in to your Apple ID account.
Tap Generate Password (below App-Specific Passwords).
Follow the onscreen instructions.
After you generate your app-specific password, enter or paste it into the password field of the app as you would normally.
For more information, see the Apple Support article Using app-specific passwords.