데비안 패키지를 만들고 있지만 모든 파일을 복사 한 후 원하는 권한 설정을하는 데 문제가 있습니다. 네트워크 응용 프로그램이고 libpcap을 사용합니다. 따라서 일반적으로 루트 권한이 필요하지만 큰 보안 문제입니다. (내 프로그램에서 임의의 공격이 공격자에 대한 완전한 루트 액세스를 의미하기 때문에) 대신에, 우리는 pcap 권한이 부여 된 그룹을 생성하는 경로를 찾아 그 그룹에 설치 사용자를 추가합니다. 메이크에서
가 보이는 같은 : 당신이 "sudo를 설치하기"를 실행하면 완전히 잘 작동
setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/myProgram
groupadd -f myGroup
usermod -a -G myGroup $(SUDO_USER)
. 나는 데비안 패키지에는 postinst 스크립트 내에서이 작업을 수행 할 때, 나는이 얻을 다음 $ (SUDO_USER) 변수가 비어 분명히 있기 때문에
var/lib/dpkg/info/myProgram-1.0.postinst: line 13: SUDO_USER: command not found
Usage: usermod [options] LOGIN
Options:
-c, --comment COMMENT new value of the GECOS field
-d, --home HOME_DIR new home directory for the user account
-e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-f, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-g, --gid GROUP force use GROUP as new primary group
-G, --groups GROUPS new list of supplementary GROUPS
-a, --append append the user to the supplemental GROUPS
mentioned by the -G option without removing
him/her from other groups
-h, --help display this help message and exit
-l, --login NEW_LOGIN new value of the login name
-L, --lock lock the user account
-m, --move-home move contents of the home directory to the
new location (use only with -d)
-o, --non-unique allow using duplicate (non-unique) UID
-p, --password PASSWORD use encrypted password for the new password
-s, --shell SHELL new login shell for the user account
-u, --uid UID new UID for the user account
-U, --unlock unlock the user account
-Z, --selinux-user new SELinux user mapping for the user account
. 이것이 다른 방법은 무엇입니까? 사용자에게 사용자 이름을 묻는 메시지를 표시해야합니까? 그것은 엄청 추한 소리. 아니면 데비안 패키지에서 이런 종류의 구성을 수행하지 않아도 될까요?
(IE :. Wireshark는 여기에 같은 문제를 가지고 있지만 그들은 단지 모든 설치시 권한 혼란을 사용자에게 그것을두고하지 않는 것)