mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
2
Running as non root user
Leonid Bugaev edited this page 2019-02-16 09:54:12 +01:00
You can enable Gor for non-root users in a secure method by using the following commands
# Following commands assume that you put `gor` binary to /usr/local/bin
addgroup gor
adduser <username> gor
chgrp gor /usr/local/bin/gor
chmod 0750 /usr/local/bin/gor
setcap "cap_net_raw,cap_net_admin+eip" /usr/local/bin/gor
As a brief explanation of the above.
- We create a group called gor.
- We then add the user you want to the new group so they will be able to use gor without sudo
- We then change the user/group of gor binary the new group.
- We then make sure the permissions are set on gor binary so that members of the group can execute it but other normal users cannot.
- We then use
setcapto give the CAP_NET_RAW and CAP_NET_ADMIN privilege to the executable when it runs. This is so that Gor can open its raw socket which is not normally permitted unless you are root.