개발노트

Mac 터미널에서 사용자 변경하기 본문

Dev-General

Mac 터미널에서 사용자 변경하기

b1tk3y 2020. 1. 10. 01:50

맥에 서브 계정을 만들었는데, 주 계정 터미널에서 서브 계정으로 변경하고 싶을 때가 있다.

 

구글링하니 바로 나온다. How to login as a different bash user in terminal?

 

How to login as a different bash user in terminal?

I have to check if my web page running locally on nginx does not work due to permission issue. My web scripts are running as _www user, so I tried to switch to _www but this does not work: maciek@...

apple.stackexchange.com

채택된 답변은 이 명령이다.

sudo -s -u _www

하지만 제대로 된 답변은 그 아래 있는 이 명령이다.

login

현재 macOS 최신 버전인 카탈리나에서도 잘 동작한다.