I am trying to run a shell script which contains an mkdir command as part of the execution. The script fails with the following error:
The user running the script is 'harry' and belongs to group 'school'. The target directory is owned by another user ‘sally’.
ls -ld /builds/somedir/
The above path (/builds/somedir/) is a Samba share.
To make it work, I tried few things but to no avail:
--------------------------------------------------
1.
2. Added following entry in /etc/sudoers file
--------------------------------------------------
After making these changes, I tried running the mkdir command manually also but no luck.
The OS is GNU\Linux.
There is one thing weird that I just noticed: even with root user, I was not able to create directory in the given path. Does it has anything to do with Samba share?
After noticing this behavior, I removed the above entry from sudoers file, and instead added the following but still no luck.
-----------------------
-----------------------
Thanks for your replies! To update, things are working now. I think i now know what blunder i was committing: i was running this script as follows:
'su' must be assuming that my intended user is 'root', and since even root user was not able to create directory in the given path, the script was failing. When i changed it to the following, it worked:
@Corona688: Nice catch! However, I am running 'mkdir -p'. By the way, even if i had not used -p option, i think i would have got a different error message, correct?
To answer your question, 'harry' belongs to another group called 'teacher'. I was wondering why 'setfacl' did not work though i could see it set using the 'getfacl' command. I was wondering about the other way that you mentioned to remedy this. Can you please hint me what you were referring to?
@ctsgnb: I am on a different machine than the Samba server. I just see the exported Samba share. Though i asked from my colleague whether the share is a Samba share or some other type of share, and he did say Samba, I was still wondering whether there is any concrete way to ascertain this. Thanks for the link ctsgnb!
To answer your question, 'harry' belongs to another group called 'teacher'. I was wondering why 'setfacl' did not work though i could see it set using the 'getfacl' command. I was wondering about the other way that you mentioned to remedy this. Can you please hint me what you were referring to?
Change the group of the dir to 'teacher' and set it group-writable.
I am using korn shell
When I type in Telnet on cmd line, I get message
"cannot execute"
How can I get permission to execute command ? In which dir is telnet located ? I looked in /usr/bin dir. but its not there
Thanks (1 Reply)
Is is possible to create the directories in following manner.
for example my home dir is empty
and i want to create dir a/b/c
mkdir a/b/c # where a/b does not exists. (5 Replies)
Hello all, I am trying to create a script or a .command file that will run for me and my other techs on many, many Mac OSX computers that will add a file to the /etc/ folder called /etc/launchd.conf
Every time I try to run the script, I get "Permission Denied" when trying to put the file into... (13 Replies)
for incompatibility installation problems, I've decided to reinstall Centos 6.3
as can be seem from the df output, I've partitioned both / and and /home directories
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda8 12G 5.3G 6.5G 45% /
tmpfs ... (2 Replies)
Hi, Unix Gurus,
- I have a simple question, I need create multiple directory. I use
mkdir {dir1, dir2, dir3)
I got one directory as
{dir1, dir2, dir3}
I searched @ google, I got answer as above code.:wall::confused:
Anybody has any idea
Thanks in advance
---------- Post updated... (3 Replies)
Hi, I have network mount on two servers.
One server I can create any directories without any issues, other server with the similar mount, I am not able to create directories starting with number!
Creation, name start with a number:
$ mkdir 1212
mkdir: cannot create directory `1212': No such... (12 Replies)
Hi All,
I have an issue that's eating my head for few days. I would appreciate if anyone could help me out in this to resolve this.
In Solaris 8 container I am facing the below issue.
As oracle user when I do ls -l in /dboracle mountpoint getting permission denied error messages.
$ ls... (3 Replies)