Operating System - HP-UX
1828631 Members
7555 Online
109983 Solutions
New Discussion

Re: folert Permissions ...can not execute file..

 
amonamon
Regular Advisor

folert Permissions ...can not execute file..

Hello I do have directory with some scripts..created as root user..now I would like to have user /I already added user/ to be able to user rwx those scripts and files in that directory..

here is /etc/passwd:

root:x:0:1:Super-User:/:/bin/bash
newuser:x:60106:1:testtest:/export/home/newuser:/bin/sh

but this newuser can not execute any on scripts in directory but I put as root 777 Permissions to that directory..still not working..

any help...:(
19 REPLIES 19
Chengchai Theerakalkul
Occasional Advisor

Re: folert Permissions ...can not execute file..

Hi,
Please login with newuser and cd to directory that you create script file. If newuser cannot please check directory permission. If it can cd to that directory run ./<script_file>. let me know error mesg if it failed.
V. Nyga
Honored Contributor

Re: folert Permissions ...can not execute file..

HI,

you also need at least 555 permissions to the scripts inside the directory.
Also are there other scripts inside the scripts?

Volkmar
*** Say 'Thanks' with Kudos ***
amonamon
Regular Advisor

Re: folert Permissions ...can not execute file..

script (test.tmp) is simple:

echo testtest> /export/home/newuser/User.cron



cd works perfect..but if I want to execute it I get:

./test.tmp: /export/home/newuser/User.cron: Permission denied



I guess it can not write file into directory..
V. Nyga
Honored Contributor

Re: folert Permissions ...can not execute file..

Hi again,

>script (test.tmp) is simple:
>echo testtest> /export/home/newuser/User.cron
>
>./test.tmp: /export/home/newuser/User.cron: >Permission denied

So check the permissions of /export/home/newuser/User.cron

V.
*** Say 'Thanks' with Kudos ***
amonamon
Regular Advisor

Re: folert Permissions ...can not execute file..

"So check the permissions of /export/home/newuser/User.cron"

User.cron is a file that can not be created by that script into certani directory..
I do not know why..
Or more clear what should I do with root created directory in order to be able to write into it certain user created files..
and how?

thanks
V. Nyga
Honored Contributor

Re: folert Permissions ...can not execute file..

Hi again,

you have to open permissions for these directories - the better solution would be to open permissions for a certain group and to assign the needed users to this group.
So you don't have to open permissions for the 'world'.
Can you create a file in this directory by 'touch'?

V.
*** Say 'Thanks' with Kudos ***
amonamon
Regular Advisor

Re: folert Permissions ...can not execute file..

$ touch tempFILE
touch: tempFILE cannot create
$


right...can not create file in directory..:(

how to enable this?
V. Nyga
Honored Contributor

Re: folert Permissions ...can not execute file..

What does 'll /export/home' and 'll /export/home/newuser' says?
Which group does newuser is in?

V.
*BTW. - you should work on your points assignment rate:
You have assigned points to 91 of 240 responses
http://forums11.itrc.hp.com/service/forums/pageList.do?userId=CA1394601&listType=unassigned&forumId=1 *
*** Say 'Thanks' with Kudos ***
Dennis Handly
Acclaimed Contributor

Re: folert Permissions ...can not execute file..

root:x:0:1:Super-User:/:/bin/bash

The first thing you should immediately do is change this back to the proper shell:
root:x:0:1:Super-User:/:/sbin/sh

Root can't have any other shell but this one. If you insist, you can execute your favorite shell once you login.

>./test.tmp: /export/home/newuser/User.cron: Permission denied

To find the permission problem you need to do:
$ id
$ ll /export/home/newuser/User.cron
$ ll -d /export/home/newuser /export/home /export
V. Nyga
Honored Contributor

Re: folert Permissions ...can not execute file..

Hi Dennis,

>To find the permission problem you need to do:
>$ id

you have to add to do it as 'newuser' ;-P

V.
*** Say 'Thanks' with Kudos ***
amonamon
Regular Advisor

Re: folert Permissions ...can not execute file..

I understood nothing...
why is it problem if my root has any other shell..that has to do nothing with my problem..
as I mentioned /etc/passwd:

root:x:0:1:Super-User:/:/bin/bash
newuser:x:60106:1:testtest:/export/home/newuser:/bin/sh

new user has no right to write in any directory?? why and how to enable newuser to be able to for example to: touch newFILE

that is topic..
THANKS fot time
V. Nyga
Honored Contributor

Re: folert Permissions ...can not execute file..

Hi again,

so show us
ll of /export/home/newuser /export/home /export

The hint about the root shell was only a good tipp from Dennis when you have a normal designed file system where root could have problems to find /bin if you are in single user mode.
And so maybe will have problems to login ...

V.
*** Say 'Thanks' with Kudos ***
amonamon
Regular Advisor

Re: folert Permissions ...can not execute file..

I am sorry I do not get it what is that I should provide??

ll ??of /export/home/newuser /export/home /export
amonamon
Regular Advisor

Re: folert Permissions ...can not execute file..

and if I hit

$id

I get this:

$ id
uid=60106(newuser) gid=1(other)
V. Nyga
Honored Contributor

Re: folert Permissions ...can not execute file..

hi again,

'ls -l' equal ll (small LL)

V.
*** Say 'Thanks' with Kudos ***
Dennis Handly
Acclaimed Contributor

Re: folert Permissions ...can not execute file..

>why is it problem if my root has any other shell. that has to do nothing with my problem.

If you have to go into single user mode or maybe reboot, you'll be hosed.

>new user has no right to write in any directory?? why and how to enable newuser ...

If you set it up that way. Of course it can write to /tmp and /var/tmp.

To be able to write to the user's home directory, it has to be owned by the user and have the proper permissions.

>I do not get it what is that I should provide?? ll ?? of

Those 3 shell commands I mentioned, executed by newuser. "ll -d" of those paths.

>uid=60106(newuser) gid=1(other)

(It is probably a good idea to assign another group name, other than "other".)

Anyway, we need to see those ll(1) commands so we can check the directory/file permissions with the UID of 60106.

>V: you have to add to do it as 'newuser'

(It would be obvious if done incorrectly. :-)
V. Nyga
Honored Contributor

Re: folert Permissions ...can not execute file..

>Dennis: (It would be obvious if done incorrectly. :-)

Yep but then you'd have to ask again ;-)

amonamon - not a bad tipp from Dennis: change your script to see if you can create a file in /tmp

A strange case - this should be solved in a very short time ... do you know, that you need also read/execute permissions for a directory to go through (yes - I know that's a silly question ...)

Volkmar
*** Say 'Thanks' with Kudos ***
amonamon
Regular Advisor

Re: folert Permissions ...can not execute file..

I do not have newuser directory creaeed..:(

$ ls -ld /export
drwxr-xr-x 3 root sys 1024 Mar 12 09:01 /export
$


$ ls -ld /export/home
drwxr-xr-x 27 root root 2048 Mar 7 14:59 /export/home
$
V. Nyga
Honored Contributor

Re: folert Permissions ...can not execute file..

Ahhhhhh!
You can't create a directory with the command echo!
You only can create a file if it doesn't exist.
The directory MUST exist!
Do a mkdir before (either in the script or by root!
If newuser shall create the directory he need write permissions, so /export/home has to have 777 permissions or better change group of this dir to 'other' and use 775 permissions.

Volkmar
*** Say 'Thanks' with Kudos ***