From owner-freebsd-questions@FreeBSD.ORG Tue Dec 2 10:55:06 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74C0E1065675 for ; Tue, 2 Dec 2008 10:55:06 +0000 (UTC) (envelope-from anthony.rasat@gmail.com) Received: from mail-gx0-f19.google.com (mail-gx0-f19.google.com [209.85.217.19]) by mx1.freebsd.org (Postfix) with ESMTP id 2CDD28FC1A for ; Tue, 2 Dec 2008 10:55:06 +0000 (UTC) (envelope-from anthony.rasat@gmail.com) Received: by mail-gx0-f19.google.com with SMTP id 12so1665277gxk.19 for ; Tue, 02 Dec 2008 02:55:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:x-rim-org-msg-ref-id :return-receipt-to:message-id:reply-to:x-priority:sensitivity :importance:to:subject:from:date:content-type:mime-version; bh=OJrBS+YXq7sT1ozkYDyymI69ATtoXuTKBjVDIz592oQ=; b=GMLvp4HOkZzbdRw0ehsPbPzC4uWwBbWeXvfdeiNtvXSrGTc+nvp1WrfH25Em2BD/vH TtVJ2XrE3CaghAaBCwDUgCEQPDNT8RUdkO0aBnC4OfIY4k9PMaDriT1TAKeLeOiVtD9t oHr0E7ttnHYIwELoqTWyDCLy8QT237TSVaAYI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=x-rim-org-msg-ref-id:return-receipt-to:message-id:reply-to :x-priority:sensitivity:importance:to:subject:from:date:content-type :mime-version; b=Uu/b22RdTay6EC/EzPWPAHbyItyHETLyP3uiklRq/6L23/2n5mTxXxQNJNEwJ7Jv5D np3mp8lztxMoe0tzTXRa+ulzVlMNFw5JoSGQIuxsI9k5X7PphEC5sjajJ7rhZqzUlaJ2 m7BilUNTbCaFy+uHITJD0lUxSVbkioVqlanXo= Received: by 10.64.204.13 with SMTP id b13mr12702042qbg.15.1228215305611; Tue, 02 Dec 2008 02:55:05 -0800 (PST) Received: from bda011.bisx.prodap.on.blackberry (bda011.bis.ap.blackberry.com [216.9.247.139]) by mx.google.com with ESMTPS id s35sm10345592qbs.13.2008.12.02.02.55.04 (version=SSLv3 cipher=RC4-MD5); Tue, 02 Dec 2008 02:55:04 -0800 (PST) X-rim-org-msg-ref-id: 1634600794 Message-ID: <1634600794-1228215302-cardhu_decombobulator_blackberry.rim.net-1868538506-@bxe1001.bisx.prodap.on.blackberry> X-Priority: Normal Sensitivity: Normal Importance: Normal To: freebsd-questions@freebsd.org From: "Anthony M. Rasat" Date: Tue, 2 Dec 2008 10:53:41 +0000 Content-Type: text/plain MIME-Version: 1.0 Subject: Re: Problem with permissions and vi X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: anthony.rasat@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2008 10:55:06 -0000 >Why I am able to put some text into >some_file.txt with >chmod 000 using vi editor and why i >can not do the same >using echo??? I'm not exactly vi master or guru here but I think it's because you write vi with :wq! command. If you write tried to write some_file.txt with :w instead, vi would complaints "cannot wrote blablabla" and so on. I assumed you wanted to write-protect your file from unauthorised tempering attempt (either from you or other user) you can do that by changing ownership of the file to other user's, most popular probably to root's. I don't think vi can overwrite different owner's file unless permission flag's permit it. -- Regards, Anthony M. Rasat Manager - Technical, Network and Support Division PT. Jawa Pos National Network Graha Pena Jawa Pos Group Building, 5th floor Jln. Raya Kebayoran Lama 12, Jakarta Barat 12210 Indonesia.- Phone 02132185562 Phone 081574217035 Fax 02153651465 Web http://www.jpnn.com