• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:root

4 # author:    chris friedhoff - chris@friedhoff.org
9 # 1 - initial release pcaps4convenience
10 # 1 - 2007.02.15 - initial release
11 # 2 - 2007.11.02 - changed to new setfcaps api; each app is now callable; supressed error of id
12 # 3 - 2007.12.28 - changed to libcap2 package setcap/getcap
13 # 4 - renamed to pcaps4server
16 # 5 - changed 'attr -S -r' to 'setcap -r' and removed attr code
20 # change the installation of different server to be able not to run as root
31 VERBOSE="-v"
41 echo -e "\n\033[00;31m $1 ...\033[00;00m\n"
46 echo -e "\033[00;32m $1 ...\033[00;00m\n"
55 printGreenMessage ":-)"
63 #for now, we work with root
64 if [ "$( id -u )" != "0" ]; then
65 echo "Sorry, you must be root !"
78 if [ "$( id -g apache 2>/dev/null )" == "" ]; then
79 groupadd -g 60 apache
81 if [ "$( id -u apache 2>/dev/null )" == "" ]; then
82 useradd -g apache -d / -u 600 apache
84 sed -i -e "{s|^\(User\).*|\1 apache|; s|^\(Group\) .*|\1 apache|}" /etc/apache/httpd.conf
85 chown $VERBOSE -R apache:apache /var/run/apache/
86 chown $VERBOSE -R apache:apache /etc/apache/
87 chown $VERBOSE -R apache:apache /var/log/apache/
95 chown $VERBOSE -R root:root /var/run/apache/
96 chown $VERBOSE -R root:root /etc/apache/
97 chown $VERBOSE -R root:root /var/log/apache/
98 chown $VERBOSE root:root /usr/sbin/httpd
99 chmod $VERBOSE u-s /usr/sbin/httpd
100 setcap -r /usr/sbin/httpd
102 sed -i -e "{s|^\(User\).*|\1 nobody|; s|^\(Group\).*|\1 nogroup|}" /etc/apache/httpd.conf
113 if [ "$( id -g apache 2>/dev/null )" == "" ]; then
114 groupadd -g 60 apache
116 if [ "$( id -u apache 2>/dev/null )" == "" ]; then
117 useradd -g apache -d / -u 600 apache
119 sed -i -e "{s|^\(User\).*|\1 apache|; s|^\(Group\) .*|\1 apache|}" /etc/httpd/httpd.conf
120 chown $VERBOSE -R apache:apache /var/run/httpd/
121 chown $VERBOSE -R apache:apache /etc/httpd/
122 chown $VERBOSE -R apache:apache /var/log/httpd/
125 #setfcaps -c cap_net_bind_service=p -e /usr/sbin/httpd
131 chown $VERBOSE -R root:root /var/run/httpd/
132 chown $VERBOSE -R root:root /etc/httpd/
133 chown $VERBOSE -R root:root /var/log/httpd/
134 chown $VERBOSE root:root /usr/sbin/httpd
135 chmod $VERBOSE u-s /usr/sbin/httpd
136 setcap -r /usr/sbin/httpd
138 sed -i -e "{s|^\(User\).*|\1 nobody|; s|^\(Group\).*|\1 nogroup|}" /etc/httpd/httpd.conf
149 if [ "$( id -g samba 2>/dev/null )" == "" ]; then
150 groupadd -g 61 samba
152 if [ "$( id -u samba 2>/dev/null )" == "" ]; then
153 useradd -g samba -d / -u 610 samba
155 chown $VERBOSE -R samba:samba /var/log/samba
156 chown $VERBOSE -R samba:samba /etc/samba
157 chown $VERBOSE -R samba:samba /var/run/samba
158 chown $VERBOSE -R samba:samba /var/cache/samba
169 chown $VERBOSE -R root:root /var/log/samba
170 chown $VERBOSE -R root:root /etc/samba
171 chown $VERBOSE -R root:root /var/run/samba
172 chown $VERBOSE -R root:root /var/cache/samba
173 chown $VERBOSE root:root /usr/sbin/smbd /usr/sbin/nmbd
174 chmod $VERBOSE u-s /usr/sbin/smbd /usr/sbin/nmbd
175 setcap -r /usr/sbin/smbd
177 setcap -r /usr/sbin/nmbd
189 if [ "$( id -g bind 2>/dev/null )" == "" ]; then
190 groupadd -g 62 bind
192 if [ "$( id -u bind 2>/dev/null )" == "" ]; then
193 useradd -g bind -d / -u 620 bind
195 chown $VERBOSE -R bind:bind /var/run/named
196 chown $VERBOSE -R bind:bind /var/named
205 chown $VERBOSE -R root:root /var/run/named
206 chown $VERBOSE -R root:root /var/named
207 chown $VERBOSE root:root /etc/rndc.key
208 chown $VERBOSE root:root /usr/sbin/named
209 chmod $VERBOSE u-s /usr/sbin/named
210 setcap -r /usr/sbin/named
222 if [ "$( id -g dhcpd 2>/dev/null )" == "" ]; then
223 groupadd -g 63 dhcpd
225 if [ "$( id -u dhcpd 2>/dev/null )" == "" ]; then
226 useradd -g dhcpd -d / -u 630 dhcpd
230 chown $VERBOSE -R dhcpd:dhcpd /var/state/dhcp/
238 chown $VERBOSE root:root /var/run/dhcpd
239 chown $VERBOSE root:root /etc/dhcpd.conf
240 chown $VERBOSE -R root:root /var/state/dhcp/
241 chown $VERBOSE root:root /usr/sbin/dhcpd
242 chmod $VERBOSE u-s /usr/sbin/dhcpd
243 setcap -r /usr/sbin/dhcpd
255 if [ "$( id -g cupsd 2>/dev/null )" == "" ]; then
256 groupadd -g 64 cupsd
258 if [ "$( id -u cupsd 2>/dev/null )" == "" ]; then
259 useradd -g cupsd -d / -u 640 cupsd
261 sed -i -e "{s|^\(User\).*|\1 cupsd|; s|^\(Group\) .*|\1 cupsd|}" /etc/cups/cupsd.conf
262 chown $VERBOSE -R cupsd:cupsd /etc/cups
263 chown $VERBOSE -R cupsd:cupsd /var/cache/cups
264 chown $VERBOSE -R cupsd:cupsd /var/log/cups
265 chown $VERBOSE -R cupsd:cupsd /var/spool/cups
266 chown $VERBOSE -R cupsd:cupsd /var/run/cups
274 chown $VERBOSE -R root:root /etc/cups
275 chown $VERBOSE -R root:lp /var/cache/cups
276 chown $VERBOSE -R root:root /var/log/cups
277 chown $VERBOSE -R root:root /var/spool/cups
278 chown $VERBOSE root:lp /var/run/cups
281 chown $VERBOSE root:root /usr/sbin/cupsd
282 chmod $VERBOSE u-s /usr/sbin/cupsd
283 setcap -r /usr/sbin/cupsd
285 sed -i -e "{s|^\(User\).*|\1 lp|; s|^\(Group\) .*|\1 sys|}" /etc/cups/cupsd.conf
316 echo " con|convert - from setuid0 to POSIX Capabilities"
317 echo " rev|revert - from POSIX Capabilities back to setui0"
318 echo " help - this help message"