Skip to Content
Suffering builds character
아카이브24.Linux부록사용자 관리1.su

1. su(switch user), 사용자 계정 변경

su 명령어를 통해 사용자 계정을 변경할 수 있음

/etc/shadow 조회

ll /etc/shadow -rw-r----- 1 root shadow 1227 date /etc/shadow

→ 접근 권한이 root(관리자)에게 있음

일반 사용자로는 접근이 불가능

cat /etc/shadow cat: /etc/shadow: Permission denied

/etc/shadow 사용자 계정별 암호가 저장된 파일

super user로 계정 전환

su - Password:

비밀번호가 설정되어 있지 않기 때문에 super user의 비밀번호 설정

sudo passwd root [sudo] password for guguttemy: New password: Retype new password: passwd: password updated successfully

→ 비밀번호는 guguttemy와 동일하게 1234로 지정

다시 su -를 통해 super user로 계정 전환

su - Password: 1234 입력

프롬프트가 아래와 같이 root 계정 및 #으로 변경됨

root@guguttemy-VirtualBox:~#

super user로 /etc/shadow 조회

cat /etc/shadow

다시 guguttemy 계정으로 전환하기

su guguttemy
Last updated on