From owner-freebsd-questions@FreeBSD.ORG Sat Jan 10 01:35:44 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAD519B9 for ; Sat, 10 Jan 2015 01:35:44 +0000 (UTC) Received: from fly.hiwaay.net (fly.hiwaay.net [216.180.54.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8631ABCD for ; Sat, 10 Jan 2015 01:35:44 +0000 (UTC) Received: from kabini1.local (rbn1-216-180-19-102.adsl.hiwaay.net [216.180.19.102]) (authenticated bits=0) by fly.hiwaay.net (8.13.8/8.13.8/fly) with ESMTP id t0A1ZfFv001337 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Fri, 9 Jan 2015 19:35:42 -0600 Message-ID: <54B08364.7050406@hiwaay.net> Date: Fri, 09 Jan 2015 19:41:56 -0600 From: "William A. Mahaffey III" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: "freebsd-questions@freebsd.org" Subject: Re: Unix copy to different groups help request References: <54B07564.4000504@gmail.com> In-Reply-To: <54B07564.4000504@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jan 2015 01:35:44 -0000 On 01/09/15 18:42, Jungle Boogie wrote: > Hello Friends, > > This just in: computers always do what you tell them to do! > > Now you great people: please teach me so I can tell my computer what > I'm trying to do. > > Objective: cp file to /usr/local/www/data for lighttpd without using > sudo all the time. > > Problem: It seems like I have the right group everywhere: file, > /usr/local /usr/local/www and I'm in that group, too. > > > User: jboogie > % id > uid=1007(jboogie) gid=1008(jboogie) > groups=1008(jboogie),0(wheel),5(operator),80(www),1002(usb) > > > % ls -l /usr/local/ > drwxr-xr-x 4 root wheel 512 Jan 5 17:19 www > > % sudo chown www:www /usr/local/www > > % ls -l /usr/local > drwxr-xr-x 4 www www 512 Jan 5 17:19 www > > % ls -l /usr/local/www/ > total 8 > drwxr-xr-x 2 www www 512 Jan 9 14:54 data > > > > % ls -l vanmorrison.txt > -rw-r--r-- 1 jboogie jboogie 144 Jan 9 16:21 vanmorrison.txt > > % cp vanmorrison.txt /usr/local/www/data > cp: /usr/local/www/data/vanmorrison.txt: Permission denied > > % sudo chgrp www vanmorrison.txt > > % ls -l > total 4 > -rw-r--r-- 1 jboogie www 144 Jan 9 16:21 vanmorrison.txt > > % cp vanmorrison.txt /usr/local/www/data > cp: /usr/local/www/data/vanmorrison.txt: Permission denied > > % chmod a+rw vanmorrison.txt > lyander-fbsd% ls -l > total 4 > -rw-rw-rw- 1 jboogie www 144 Jan 9 16:21 vanmorrison.txt > > % cp vanmorrison.txt /usr/local/www/data > cp: /usr/local/www/data/vanmorrison.txt: Permission denied > > Try a 'chmod -R g+w' on /usr/local/www. You changed permissions on the file (source) itself, that's not the problem, the destination is the issue. -- William A. Mahaffey III ---------------------------------------------------------------------- "The M1 Garand is without doubt the finest implement of war ever devised by man." -- Gen. George S. Patton Jr.