Why sez "bash: /dev/null: Permission denied" ???

Why sez "bash: /dev/null: Permission denied" ???

Post by Jimmy Navarr » Tue, 21 Aug 2001 06:04:20



I installed Red Hat 7.1 last week, it was working okay.  I downlaoded
'nmap-2.54BEA7-3.i386.rpm', 'rpm -i'  and  played port scanning my home
network, ISP, work while still login as root.  Then I login as non-root,
now sez:

bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied

I login back as root and 'chmod 777 /dev/null'.   Why saying "bash:
/dev/null: Permission denied"  when it wasn't doing that before?

 
 
 

Why sez "bash: /dev/null: Permission denied" ???

Post by Swif » Tue, 21 Aug 2001 18:03:14



>  I login back as root and 'chmod 777 /dev/null'.   Why saying "bash:
>  /dev/null: Permission denied"  when it wasn't doing that before?

Why is unclear to me, but the normal mode is
        ~$ ls -l /dev/null
        crw-rw-rw-    1 root     devices    1,   3 Apr 22 14:20 /dev/null

--
  SwifT
  |- LUG : http://www.lugwv.be
  |- PGP Key-# : 0xCDBA2FDB
  `- "Happy GNU/Linux-user :)"

 
 
 

Why sez "bash: /dev/null: Permission denied" ???

Post by Villy Kru » Tue, 21 Aug 2001 20:45:29


On Mon, 20 Aug 2001 09:03:14 GMT,


>>  I login back as root and 'chmod 777 /dev/null'.   Why saying "bash:
>>  /dev/null: Permission denied"  when it wasn't doing that before?

>Why is unclear to me, but the normal mode is
>    ~$ ls -l /dev/null
>    crw-rw-rw-    1 root     devices    1,   3 Apr 22 14:20 /dev/null

The question is rather, what program did modify the permission of /dev/null?
That program should probably be fixed so it no longer does that.

Villy

 
 
 

Why sez "bash: /dev/null: Permission denied" ???

Post by Swif » Wed, 22 Aug 2001 04:27:40


On 20 Aug 2001 11:45:29 GMT, Villy Kruse


>  The question is rather, what program did modify the permission of /dev/null?
>  That program should probably be fixed so it no longer does that.

If it is a program that did this (nmap from what I understand - although I
don't have any troubles with nmap) and not a careless user logged in as root
(no offence).

OP: look at the root's .bash_history and see what tools you have ran. Test
each tool to see if that was the one that did it.

--
  SwifT
  |- LUG : http://www.lugwv.be
  |- PGP Key-# : 0xCDBA2FDB
  `- "Happy Linux-user :)"

 
 
 

Why sez "bash: /dev/null: Permission denied" ???

Post by Jimmy Navarr » Wed, 22 Aug 2001 11:41:03


When I ran 'chmod 777 /dev/null' it should show crwxrwxrwx but not anymore.

I downloaded linuxconf-1.24r2-10.i386.rpm when 'rpm -i linuxconf*' it
prompted to fix or do nothing to the /dev/null.  I selected 'fix it' so
permission so now seems normal again...

Script started on Mon Aug 20 19:31:18 2001
$  ls -l /dev/null
crw-rw-rw-    1 root     root       1,   3 Mar 23 20:37   /dev/null
~ $ exit
Script done on Mon Aug 20 19:31:26 2001

Still I don't have clue why I got that that '/dev/null: Permission denied' in
the first place.

Thanks.



> >  I login back as root and 'chmod 777 /dev/null'.   Why saying "bash:
> >  /dev/null: Permission denied"  when it wasn't doing that before?

> Why is unclear to me, but the normal mode is
>         ~$ ls -l /dev/null
>         crw-rw-rw-    1 root     devices    1,   3 Apr 22 14:20 /dev/null

> --
>   SwifT
>   |- LUG : http://www.lugwv.be
>   |- PGP Key-# : 0xCDBA2FDB
>   `- "Happy GNU/Linux-user :)"

 
 
 

Why sez "bash: /dev/null: Permission denied" ???

Post by Villy Kru » Wed, 22 Aug 2001 16:12:05


On Mon, 20 Aug 2001 19:27:40 GMT,

>On 20 Aug 2001 11:45:29 GMT, Villy Kruse

>>  The question is rather, what program did modify the permission of /dev/null?
>>  That program should probably be fixed so it no longer does that.

>If it is a program that did this (nmap from what I understand - although I
>don't have any troubles with nmap) and not a careless user logged in as root
>(no offence).

Could be an output file you have specified as a real file, but the OP has
specified as /dev/null.  If the program has the idea that this file should
be root accessible only then it might chmod the output file.  Cases like
this is not unheard of.

The careless part might be a recursive chown gone wild, but then I would
suspect much more damage done in the /dev directory.

Villy

 
 
 

Why sez "bash: /dev/null: Permission denied" ???

Post by Dave Bro » Thu, 23 Aug 2001 02:31:50



> Still I don't have clue why I got that that '/dev/null: Permission denied' in
> the first place.

I'd have to see the line that you typed when you got the error message.
For instance:

  echo Hello > /dev/null   # works fine

but:

  echo Hello | /dev/null   # gives "/dev/null: Permission denied"

Not that you couldn't write to it, but you can't execute it.

--
Dave Brown  Austin, TX

 
 
 

Why sez "bash: /dev/null: Permission denied" ???

Post by Jimmy Navarr » Thu, 23 Aug 2001 14:46:41




> > Still I don't have clue why I got that that '/dev/null: Permission denied' in
> > the first place.

> I'd have to see the line that you typed when you got the error message.
> For instance:

>   echo Hello > /dev/null   # works fine

> but:

>   echo Hello | /dev/null   # gives "/dev/null: Permission denied"

> Not that you couldn't write to it, but you can't execute it.

> --
> Dave Brown  Austin, TX

I was the one made the original posting and lookie what I found.  I was reading
through a book Red Hat? Linux? 7 Server by Mohammed J. Kabir ISBN 0-7645-4786-0 at
Barnes & Noble and I ended up buying it.  I think it's a good reference...

In chapter 4:  Understanding UNIX files and Devices says, if something that was
working yesterday and day before yesterday all of a sudden stops working today,
the first suspect is permission problem.  One of the most common causes of
permission problem is that after using Mr. Superuser 'root' account.   Many of
inexperienced superusers like me often access files and run programs using Mr.
Superuser 'root' account.  When a program is run using 'root 'as user account, the
files that such program creates can often be set with root ownership.  Mr. Nobody
user logins and he can't access the file because Mr. Superuser 'root' already owns
it.

I've been using UNIX for almost 10 years as non root I didn't even know that.

 
 
 

Why sez "bash: /dev/null: Permission denied" ???

Post by Jimmy Navarr » Thu, 23 Aug 2001 14:50:46



> On Mon, 20 Aug 2001 19:27:40 GMT,

> >On 20 Aug 2001 11:45:29 GMT, Villy Kruse

> >>  The question is rather, what program did modify the permission of /dev/null?
> >>  That program should probably be fixed so it no longer does that.

> >If it is a program that did this (nmap from what I understand - although I
> >don't have any troubles with nmap) and not a careless user logged in as root
> >(no offence).

> Could be an output file you have specified as a real file, but the OP has
> specified as /dev/null.  If the program has the idea that this file should
> be root accessible only then it might chmod the output file.  Cases like
> this is not unheard of.

> The careless part might be a recursive chown gone wild, but then I would
> suspect much more damage done in the /dev directory.

> Villy

> On Mon, 20 Aug 2001 19:27:40 GMT,

> >On 20 Aug 2001 11:45:29 GMT, Villy Kruse

> >>  The question is rather, what program did modify the permission of /dev/null?
> >>  That program should probably be fixed so it no longer does that.

> >If it is a program that did this (nmap from what I understand - although I
> >don't have any troubles with nmap) and not a careless user logged in as root
> >(no offence).

> Could be an output file you have specified as a real file, but the OP has
> specified as /dev/null.  If the program has the idea that this file should
> be root accessible only then it might chmod the output file.  Cases like
> this is not unheard of.

> The careless part might be a recursive chown gone wild, but then I would
> suspect much more damage done in the /dev directory.

> Villy

I was the one made the original posting and lookie what I found.  I was reading
through a book Red Hat? Linux? 7 Server by Mohammed J. Kabir ISBN 0-7645-4786-0 at
Barnes & Noble and I ended up buying it.  I think it's a good reference...

In chapter 4:  Understanding UNIX files and Devices says, if something that was
working yesterday and day before yesterday all of a sudden stops working today, the
first suspect is permission problem.  One of the most common causes of permission
problem is that after using Mr. Superuser 'root' account.   Many of inexperienced
superusers like me often access files and run programs using Mr. Superuser 'root'
account.  When a program is run using 'root 'as user account, the files that such
program creates can often be set with root ownership.  Mr. Nobody user logins and
he can't access the file because Mr. Superuser 'root' already owns it.

I've been using UNIX for almost 10 years as non root I didn't even know that.

 
 
 

1. "weof" operation in "mt" command gives "permission denied"

Hi,

Some time ago I made a mistake and deleted my /dev directory.  Since
then, I have had to occasionally run the "mknod" command to create a
device here and there.  I did have a directory list of /dev, and I have
used that as a guide for which major and minor node numbers to use, and
which type of file to create.

Anyway, my Exabyte 8200 is /dev/nrst0, which is listed as:

  crw-rw-rw-   1 root     wheel      9, 128 Oct 29 09:30 /dev/nrst0

I am trying to write 2 eof marks after the end of file 0, so that I can
re-write file 1.  The sequence that I use for this on the the same tape
at work (and this works just fine) is:

  1) mt -f /dev/nrst0 asf 1   position after the first eof (after file 0)
  2) mt -f /dev/nrst0 bsf 1   position before the first eof
  3) mt -f /dev/nrst0 weof 2  make it look like file 0 is only file on tape
  4) mt -f /dev/nrst0 bsf 1   position after the first eof

When I try this with linux, the weof command (step 3) results in:

  mt: /dev/nrst0: Permission denied

Is this a problem with the driver, or is there something wrong with my
device definition.  According to the man page, I should be able to do
this under Linux pretty much the same as it works under SunOS.

There is no problem writing to the tape otherwise.

I have Slackware 2.x.

thanks,
tw

2. ][2.4-ac] opti621 can't do dma

3. Why "fdisk /dev/hdb1" works but not "fdisk /dev/hdb"!?

4. page frame number ?

5. RH 6.0 + bash: Can login, but "No directory /bin/bash" or "bash: /dev/tty[1-6]: Permission denied"

6. X-windows on toshiba satellite 300cdt with a c&t 65555 graphics chip HELP!!

7. "> file" versus "cp /dev/null file"

8. Bad sectors recovery in ReiserFS.

9. pccardd[49]: No card in database for "(null)"("(null)")

10. "Permission denied" when trying to change root shell to gnu bash ?

11. lilo: "Fatal: open /dev/hda1 Permission denied"

12. "cannot open /dev/modem: permission denied"

13. xxgdb: "/dev/ttyp4: Permission denied"?