![루트 사용자에 대한 스냅 패키지 경고를 비활성화하는 방법은 무엇입니까? [폐쇄]](https://linux55.com/image/213018/%EB%A3%A8%ED%8A%B8%20%EC%82%AC%EC%9A%A9%EC%9E%90%EC%97%90%20%EB%8C%80%ED%95%9C%20%EC%8A%A4%EB%83%85%20%ED%8C%A8%ED%82%A4%EC%A7%80%20%EA%B2%BD%EA%B3%A0%EB%A5%BC%20%EB%B9%84%ED%99%9C%EC%84%B1%ED%99%94%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%EC%9D%80%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F%20%5B%ED%8F%90%EC%87%84%5D.png)
루트 사용자에 대해 다음 경고를 비활성화하고 싶습니다.
You are trying to start Visual Studio Code as a super user which isn't recommended. If this was intended, please add the argument `--no-sandbox` and specify an alternate user data directory using the `--user-data-dir` argument.
스냅샷을 실행할 때마다 --no-sandbox 매개변수를 입력할 필요가 없습니다. 나는 그들에게 모든 별칭을 부여하고 싶지 않습니다. 나는 보안 위험에 대해 잘 알고 있습니다. 개인적인 용도로 가상 머신에서만 이 작업을 수행하겠습니다. 구성 파일을 편집하거나 이 오류를 우회할 수 있는 방법이 있습니까?
답변1
이 python3 해결 방법을 만들었습니다.
#!/usr/bin/python
import os
import sys
if __name__ == "__main__":
if len(sys.argv) <= 1:
print("No snap specified")
exit(-1)
else:
os.system(sys.argv[1] + " --no-sandbox " + ' '.join(sys.argv[2:]))
exit(0)
경로에 추가
예:
코드 --user-data-dir ~/.vscode를 실행합니다.