Newbie with vi, can't write unless root

Newbie with vi, can't write unless root

Post by Steven Charbonnea » Wed, 25 Jul 2001 04:24:51



Hi,
I created a new account so I wouldn't be logged in as root all the time. I
am able to open vi and start writing when logged in under the new account,
but when I "::wq!" I get a message "Can't open the file for writing". I can
only write files when logged in as root. Any ideas?
 
 
 

Newbie with vi, can't write unless root

Post by Swif » Wed, 25 Jul 2001 04:38:39


On Mon, 23 Jul 2001 14:24:51 -0500, Steven Charbonneau


> Hi,
> I created a new account so I wouldn't be logged in as root all the time. I
> am able to open vi and start writing when logged in under the new account,
> but when I "::wq!" I get a message "Can't open the file for writing". I can
> only write files when logged in as root. Any ideas?

Where do you want to write your file? You only have write acces in your
home-directorie and in /tmp...

Also, it's ":wq", not "::wq".

--
 SwifT                     -    Key-ID CDBA2FDB
 LUG: http://www.lugwv.be  -    http://www.keyserver.net

 
 
 

Newbie with vi, can't write unless root

Post by Jorey Bum » Wed, 25 Jul 2001 14:35:46



> Hi,
> I created a new account so I wouldn't be logged in as root all the time. I
> am able to open vi and start writing when logged in under the new account,
> but when I "::wq!" I get a message "Can't open the file for writing". I
> can only write files when logged in as root. Any ideas?

If the file is owned by root or another user, you can't edit it. root can
edit any file, regardless of user or permissions.
 
 
 

Newbie with vi, can't write unless root

Post by Federico Brav » Wed, 25 Jul 2001 15:57:39


....................

Quote:

> Also, it's ":wq", not "::wq".

> --
>  SwifT                     -    Key-ID CDBA2FDB
>  LUG: http://www.lugwv.be  -    http://www.keyserver.net

Why not ':x' ?
 
 
 

Newbie with vi, can't write unless root

Post by Steven Charbonnea » Thu, 26 Jul 2001 03:00:47


Thanks SwifT,
that was it.


> On Mon, 23 Jul 2001 14:24:51 -0500, Steven Charbonneau

> > Hi,
> > I created a new account so I wouldn't be logged in as root all the time.
I
> > am able to open vi and start writing when logged in under the new
account,
> > but when I "::wq!" I get a message "Can't open the file for writing". I
can
> > only write files when logged in as root. Any ideas?

> Where do you want to write your file? You only have write acces in your
> home-directorie and in /tmp...

> Also, it's ":wq", not "::wq".

> --
>  SwifT                     -    Key-ID CDBA2FDB
>  LUG: http://www.lugwv.be  -    http://www.keyserver.net

 
 
 

Newbie with vi, can't write unless root

Post by Robert_ » Thu, 26 Jul 2001 11:31:10




> ....................

>> Also, it's ":wq", not "::wq".

>> --
>>  SwifT                     -    Key-ID CDBA2FDB
>>  LUG: http://www.lugwv.be  -    http://www.keyserver.net

> Why not ':x' ?

ust passing though and noticed the above-thanks, didn't know about that
one.  
Robert_L
--
registered as Linux user #214645
 
 
 

Newbie with vi, can't write unless root

Post by b » Mon, 30 Jul 2001 02:53:13


On Mon, 23 Jul 2001 14:24:51 -0500, "Steven Charbonneau"


>Hi,
>I created a new account so I wouldn't be logged in as root all the time. I
>am able to open vi and start writing when logged in under the new account,
>but when I "::wq!" I get a message "Can't open the file for writing". I can
>only write files when logged in as root. Any ideas?

YOu are trying to create a file in a directory in which you don't have
writing permissions.
Try to create a file in your /home/[username] directory and you will
see that it works.

Good luck

bart

 
 
 

1. chmod won't work unless I'm the owner, or root

I'm trying to chmod a file that I have group permission on, but I'm not the
owner.  And it won't do it.  Please point me in the right direction...

Chmod, chown won't work.  But cat will.  So therefore I don't think it's a
permission problem, but something I'm missing with chmod, Linux RedHat
9.0(I'm an old HP-UX guy where this works fine), or something I've setup (or
not setup) with security...

Side note:  I noticed this when actually trying to change the bits thru
Samba, which led me to the fundamental Linux question.

Thanks,
Chris

Details below:

The file looks like:
$ls -l tempo
-rw-rw-r--    1 foobar1  users           10 May 22 09:54 tempo
$

I am logged in as "chris", not "foobar1" with a gid of 100 (users).  I.e.
different uid, same gid.

This is being done in /tmp which looks like "drwxrwxrwt   12 root     root
4096 May 22 09:54 tmp"

The error message is:
$chmod 666 tempo
chmod: changing permissions of `tempo': Operation not permitted
$

$chmod --version
chmod (coreutils) 4.5.3
Written by David MacKenzie.

Copyright (C) 2002 Free Software Foundation, Inc.
$
$uname -a
Linux fatbstd 2.4.18-18.8.0 #7 Fri Dec 6 09:53:30 PST 2002 i686 i686 i386
GNU/Linux
$

2. Linux W/ SBPCD drivers...

3. Can't talk on GPIB unless I'm root

4. WINS and Linux

5. Legato backup won't write unless I am snooping

6. HP III Printer Configuartion

7. RH5.0: netcfg won't run unless root

8. mod_proxy and REMOTE_ADDR

9. DOSEMU serial port won't work unless run as root

10. kppp help, can't dial out unless as root

11. cdrom icon on desktop doesn't unmount unless root

12. Can't open COM1 unless root - how to fix?

13. ELM can't read Mail unless you are root!!!