An electronic device comprising: an interface configured to connect an audio output device and the electronic device; an audio circuit configured to transmit an audio signal to the audio output device connected to the electronic device through the interface, wherein the audio circuit includes an analog/digital A/D converter; a memory having stored therein a file having restricted user access, user authentication information about a registered user of the electronic device, and instructions; and at least one processor electrically connected to the memory, wherein, when the stored instructions are executed, the at least one processor is configured to: transmit a test signal to the audio output device through the audio circuit, for a specified time; receive a first feedback signal corresponding to the test signal transmitted for the specified time from the audio output device through the audio circuit; obtain pulse code modulation, PCM, data corresponding to the received first feedback signal through the A/D converter; compare the PCM data with the user authentication information; determine whether a user wearing the audio output device is indicated as the registered user based on the comparison of the PCM data with the user authentication information; and, when the user wearing the audio output device is indicated as the registered user: - unlock the electronic device in a lock state; and - permit access to the file without additional authentication, wherein the processor is further configured to: transmit the test signal to the audio output device for a second time shorter than the specified time, receive a second feedback signal corresponding to the test signal transmitted for the second time from the audio output device through the audio circuit, and set an output level of the audio signal based on an impedance of the audio output device determined by the A/D converter through the received second feedback signal. an interface configured to connect an audio output device and the electronic device; an audio circuit configured to transmit an audio signal to the audio output device connected to the electronic device through the interface, wherein the audio circuit includes an analog/digital A/D converter; a memory having stored therein a file having restricted user access, user authentication information about a registered user of the electronic device, and instructions; and at least one processor electrically connected to the memory, wherein, when the stored instructions are executed, the at least one processor is configured to: transmit a test signal to the audio output device through the audio circuit, for a specified time; receive a first feedback signal corresponding to the test signal transmitted for the specified time from the audio output device through the audio circuit; obtain pulse code modulation, PCM, data corresponding to the received first feedback signal through the A/D converter; compare the PCM data with the user authentication information; determine whether a user wearing the audio output device is indicated as the registered user based on the comparison of the PCM data with the user authentication information; and, when the user wearing the audio output device is indicated as the registered user: - unlock the electronic device in a lock state; and - permit access to the file without additional authentication, wherein the processor is further configured to: transmit the test signal to the audio output device for a second time shorter than the specified time, receive a second feedback signal corresponding to the test signal transmitted for the second time from the audio output device through the audio circuit, and set an output level of the audio signal based on an impedance of the audio output device determined by the A/D converter through the received second feedback signal. transmit a test signal to the audio output device through the audio circuit, for a specified time; receive a first feedback signal corresponding to the test signal transmitted for the specified time from the audio output device through the audio circuit; obtain pulse code modulation, PCM, data corresponding to the received first feedback signal through the A/D converter; compare the PCM data with the user authentication information; determine whether a user wearing the audio output device is indicated as the registered user based on the comparison of the PCM data with the user authentication information; and, when the user wearing the audio output device is indicated as the registered user: - unlock the electronic device in a lock state; and - permit access to the file without additional authentication, - unlock the electronic device in a lock state; and - permit access to the file without additional authentication, wherein the processor is further configured to: transmit the test signal to the audio output device for a second time shorter than the specified time, receive a second feedback signal corresponding to the test signal transmitted for the second time from the audio output device through the audio circuit, and set an output level of the audio signal based on an impedance of the audio output device determined by the A/D converter through the received second feedback signal. transmit the test signal to the audio output device for a second time shorter than the specified time, receive a second feedback signal corresponding to the test signal transmitted for the second time from the audio output device through the audio circuit, and set an output level of the audio signal based on an impedance of the audio output device determined by the A/D converter through the received second feedback signal.