Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git Pull 파일 소유자 문의 #1154

Open
Macfa opened this issue Oct 4, 2021 · 1 comment
Open

Git Pull 파일 소유자 문의 #1154

Macfa opened this issue Oct 4, 2021 · 1 comment

Comments

@Macfa
Copy link

Macfa commented Oct 4, 2021

해결하고자 하는 문제

AWS 접근 시 사용하는 계정 - ubuntu ( ubuntu:ubuntu )
apache 에서 사용되는 계정 - www-data ( www-data:www-data )
/etc/groups - www-data 에 ubuntu 의 권한부여되어있음 ( aws ec2 기본값 )

AWS 를 사용 중인데 git pull 후에
ubuntu:ubuntu 권한이 들어가서
아파치에서 못 불러오는 현상이 있습니다
이를 해결하고자 합니다.

문의

  1. ubuntu 에 www-data 권한을 줘서
    www-data 가 ubuntu 를 읽을 수 있게끔 하려고 하는데
    이렇게 했을 때, 아파치운용만을 하는 계정이여야하는데 다른 것도 가능하다는 점에서
    이렇게 권한 설정을 해도 될까요 ?

  2. git pull 시,
    ubuntu 계정에서 pull 시에
    ubuntu:ubuntu 가 아니라
    ubuntu:www-data 로 권한을 줘서 불러올 수 없을까요 .. ?

코드 혹은 오류

git pull origin
@yoobato
Copy link
Collaborator

yoobato commented Jan 12, 2023

1, 2를 합쳐서 답변을 드리자면, 하나의 계정을 여러 개의 그룹에 넣는게 가능합니다.
따라서, ubuntu 계정을 ubuntu, www-data 두 그룹 모두에 속하게 구성하면 될 것 같습니다.

명령어 : usermod -a -G ubuntu,www-data ubuntu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants