Operating System - HP-UX
1748122 Members
3258 Online
108758 Solutions
New Discussion юеВ

Re: vi: permission denied

 
Amit Manna_4
Occasional Advisor

vi: permission denied

hi
I am getting the following error:


home directory: /home/oraadmin need ability to vi a file. I tried it and
met with this error:

pfin4> vi mel.txt:
"/db/pfin4/oracle/tmp/Ex28183" Permission denied

fs2 oraadmin /home/oraadmin
pfin4>



Please suggest
9 REPLIES 9
Torsten.
Acclaimed Contributor

Re: vi: permission denied

You are probably not the owner of this file and/or don't have permission to write/modify it, hence Permission denied.

Not enough information to suggest more.

Do

# id
or
# whoami
and
# ll /db/pfin4/oracle/tmp/Ex28183

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Amit Manna_4
Occasional Advisor

Re: vi: permission denied

none> id
uid=154(oraadmin) gid=140(dba)
fs1 oraadmin /home/oraadmin
none> whoami
oraadmin
fs1 oraadmin /home/oraadmin
none> ll /db/pfin4/oracle/tmp/Ex28183
/db/pfin4/oracle/tmp/Ex28183 not found
fs1 oraadmin /home/oraadmin
none>
OldSchool
Honored Contributor

Re: vi: permission denied

looks like "vi" is trying to create its tmp file in

/db/pfin4/oracle/tmp

for whatever reason, and you dont have sufficient right.

normally, they should have gone to /var/tmp. you might look in the home directory of oraadmin for a ".exrc" file. if it exists, see if it sets "dir=..."
Sunny123_1
Esteemed Contributor

Re: vi: permission denied

Hi

Check the owner and permission of /db/pfin4/oracle/tmp Or do

chown -R oraadmin:dba /db/pfin4/oracle/tmp

Regards
Sunny
Amit Manna_4
Occasional Advisor

Re: vi: permission denied

$> pwd
/home/oraadmin
fs2 orapfin4 /home/oraadmin
$> ll
total 38
-rwxr-xr-x 1 oraadmin dba 1486 Apr 13 14:40 ReorgScript2.sql
-rwxr-xr-x 1 oraadmin dba 1717 Apr 13 18:39 alter_objects.sql
drwxr-xr-x 2 oraadmin dba 96 Aug 12 11:53 bin
-rwxr-xr-x 1 oraadmin dba 728 Apr 13 20:02 ffin1_reorg
-rwxr-xr-x 1 oraadmin dba 728 Apr 13 20:04 ffin1_reorg_copy
-rwxr-xr-x 1 oraadmin dba 52 Apr 13 17:29 ffin1_reorg_run
-rwxr-xr-x 1 oraadmin dba 84 Apr 13 16:31 ffin1_reorg_run_ORIG
-rwxr-xr-x 1 oraadmin dba 603 Apr 13 17:15 index_check.sql
-rwxr-xr-x 1 oraadmin dba 54 Apr 13 17:28 index_check1
drwxr-xr-x 2 oraadmin dba 1024 Mar 27 14:10 local
-rw-r--r-- 1 oraadmin dba 0 Aug 11 19:14 mel.txt
-rwxr-xr-x 1 oraadmin dba 2399 Apr 13 20:04 null
-rwxr-xr-x 1 oraadmin dba 209 Aug 11 18:48 quantumZ_exp
-rwxr-xr-x 1 oraadmin dba 1462 May 2 21:58 reorg.log
-rwxr-xr-x 1 oraadmin dba 499 Apr 13 20:04 reorgscript.log
-rw-r--r-- 1 oraadmin dba 12 Aug 12 10:36 test
fs2 orapfin4 /home/oraadmin

When i login from root and do su to orapfin4 user and then do /home/oraadmin i am not able to create a file there


please suggest






OldSchool
Honored Contributor

Re: vi: permission denied

you looked at:

"$> pwd
/home/oraadmin
.......
$> ll
....."


which is NOT:

/db/pfin4/oracle/tmp

also, did you look for a .exrc file in the $HOME directory of user "orapfin4" , as in:

cd
ls -l .exrc

?????
Tingli
Esteemed Contributor

Re: vi: permission denied

Is it an nfs mounted file system?
Steven Schweda
Honored Contributor

Re: vi: permission denied

> [...] for whatever reason, [...]

I know nothing, and I don't see it in the
"vi" "man" page, but I'd guess that "vi" uses
tempnam() or some such function to create its
temporary file, so that its behavior is
affected by the environment variable TMPDIR.

echo $TMPDIR

> [...] and you dont have sufficient right.

Setting TMPDIR to a directory where you don't
have write permission is an invitation to
trouble. Many programs (like, I assume,
"vi") use this mechanism, so I'd expect more
than "vi" to fail when TMPDIR is set to an
inappropriate value.

As usual, actual experimentation would be the
best test, but I don't have an HP-UX system
of this version up and running, and it's warm
today, and I'm lazy.
OldSchool
Honored Contributor

Re: vi: permission denied

Vi's working directory is /tmp or /var/tmp by default. It can be changed with a "set dir="string" command, which is why I asked about the .exrc file previously, as vi will use that to set user-defined behaviour when it starts....

so far, I'm not even sure the OP is looking at the correct directories, either HOME or the temp dir where the opened failed......