Raspberry Pi_Kor_12.6.2 사용자 암호 변경


Published Book on Amazon


All of IOT

Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 1

All of IOT

Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 2


출판된 한글판 도서


최신 라즈베리파이(Raspberry Pi)로 시작하는 사

물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (상)

최신 라즈베리파이(Raspberry Pi)로 시작하는 사

물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (하)


Original Book Contents


12.6.2  사용자 암호 변경

 

12.6.2.1    사용자 암호 변경 개요

 

사용자 암호는 시스템을 외부의 위협으로부터 지키지 위한 가장 기본적인 수단이다. 따라서 적절한 암호를 부여하고, 사후 관리를 잘하는 것이 시스템 관리의 중요한 과제이다.

 

사용자 암호는 사용자 계정을 생성하면서 동시에 지정할 수도 있고, 사용자 계정을 생성한 후에 사후에 암호를 지정할 수도 있다. 또한 기존에 부여된 암호를 삭제할 수도 있고, 다른 암호로 변경할 수도 있다.

 

12.6.2.2    "passwd" 명령

 

사용자 암호와 관련된 정보를 변경하기 위해서는 passwd 명령을 사용한다. 시스템에 logon한 사용자는 이 명령을 이용해서 자기 자신의 암호를 변경할 수 있다. 또한 시스템 관리자는 다른 사용자의 암호에 대해서도 작업을 할 수 있다이 명령을 이용해서 새로운 암호를 부여할 수도 있고 기존에 부여된 암호를 변경하거나 삭제할 수도 있으며, 유효기간을 조정할 수도 있다.  

 

[명령 형식]

passwd [option] [logon user]

 

[명령 개요]       

    지정된 사용자 계정의 암호를 변경한다.

    user 권한    -- 일반 user.      -- 자기 자신의 암호를 변경하고자 할 때

-- super user      -- 다른 사용자의 암호를 변경하고자 할 때


 

[상세 설명]

    이 명령은 사용자 계정에 대한 암호를 변경한다. 일반 사용자는 자신의 계정에 대해서만 암호를 변경할 수 있지만, super user는 모든 계정에 대한 암호도 변경할 수 있다

    logon user를 지정하지 않으면, logon한 자기 자신의 사용자 계정에 대한 암호를 변경하는 것이다.

    다른 사용자의 암호를 변경하기 위해서는 super user 권한이 필요하다.

 

[주요 Option]

-d, --delete

Delete a user's password (make it empty). This is a quick way to disable a password for an account. It will set the named account passwordless.

-e, --expire

 

Immediately expire an account's password. This in effect can force a user to change his/her password at the user's next login.

-i, --inactive INACTIVE

 

This option is used to disable an account after the password has been expired for a number of days. After a user account has had an expired password for INACTIVE days, the user may no longer sign on to the account.

-l, --lock

 

Lock the password of the named account. This option disables a password by changing it to a value which matches no possible encrypted value (it adds a ´!´ at the beginning of the password).

 

Note that this does not disable the account. The user may still be able to login using another authentication token (e.g. an SSH key). To disable the account, administrators should use usermod --expiredate 1 (this set the account's expire date to Jan 2, 1970).

 

Users with a locked password are not allowed to change their password.

-S, --status

 

Display account status information. The status information consists of 7 fields. The first field is the user's login name. The second field indicates if the user account has a locked password (L), has no password (NP), or has a usable password (P). The third field gives the date of the last password change. The next four fields are the minimum age, maximum age, warning period, and inactivity period for the password. These ages are expressed in days.

-u, --unlock

 

Unlock the password of the named account. This option re-enables a password by changing the password back to its previous value (to the value before using the -l option).

 

[Files]

/etc/passwd

User account information.

/etc/shadow

Secure user account information.

/etc/pam.d/passwd

PAM configuration for passwd.

 

[사용 Example]

logon 사용자 계정에 대해서 스스로 암호를 변경하기 위해서는 다음과 같은 작업을 한다.Terminal 화면에서 해당 명령을 수행하면 암호를 변경하는 작업이 시작된다.

 

pi@raspberrypi ~ $ passwd

Changing password for pi.

(current) UNIX password:

Enter new UNIX password:

Retype new UNIX password:

passwd: password updated successfully

 

먼저 해당 사용자에 대한 현재 암호를 확인하는 메시지가 나타난다. 현재 암호를 정확히 입력하고 [Enter] 버튼을 누르면 새로운 암호를 입력하는 작업이 시작된다. 사용자 "pi"에 대한 새로운 암호를 입력하고 [Enter] 버튼을 누른다. 그러면 암호 확인을 위해서 암호를 다시 입력하도록 하는 요청이 나타나는데, 해당 암호를 다시 입력하고 [Enter] 버튼을 누르면 암호 변경이 완료된다. 작업이 완료되면 암호 변경이 완료되었음을 알려주는 메시지가 나타난다


 

12.6.2.3    시스템 기본 사용자 "pi"에 대한 암호 변경

 

"pi" 사용자는 시스템 관리를 위해서 시스템에서 기본적으로 제공하는 사용자로 시스템의 설치 및 관리를 위해서 사용되는 사용자이다앞에서도 설명했지만 시스템에서 기본적으로 제공하는 "pi" 사용자에게는 "raspberry" 라는 초기 암호가 지정되어 있고, 시스템 설치가 완료되면 이 암호를 변경해야 한다

 

"pi" 사용자의 암호를 변경하는 방법으로 시스템 booting 항목 설정 도구인 "raspi-config" 명령을 이용할 수 있다. 여기에 대해서는 [9.4 default user "pi"에 대한 사용자 암호 변경]의 설명을 참조하기 바란다.

 

 


 

Leave a Reply