Sponsored Content
Top Forums Shell Programming and Scripting How to create a directory inside root as different user Post 302331617 by rcjmack on Monday 6th of July 2009 05:14:06 PM
Old 07-06-2009
vbe is correct to ask for ownership and permissions on /opt/test.

Just a little background, any time you create a new file or directory UNIX/Linux sets the ownership to the user id and group id of the user creating the file. The permissions that vbe mentions are if you can read, write, or execute the file. These are set to a default value that is part of your environment.

Here is a few commands that you might be interested in:

chown - changes the ownership of a file for user id.
chgrp - changes the ownership of a file for group id.

chmod - permission of files.

umask - default permissions for newly created files.

Hope these helps, let me know if I have helped.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

create or modify user account to have same access as root

Is there a way to create or better yet modify a user account so it has the same privs as root? (6 Replies)
Discussion started by: xadamz23
6 Replies

2. UNIX for Advanced & Expert Users

Other than root user .Normal user is unable to create files

Hi all, I am using Sun Solaris 9 .In this system normal users unable to create files from the command line.I added these users in bin,adm and even root group i found them unable to create a file. (1 Reply)
Discussion started by: mallesh
1 Replies

3. AIX

create user like root

hello I would like to create another user like root With smit user, I have duplicate all the configuration from root to root2 (groupe, secondary group, administrative, etc...) But when I connect with root2, i don't go to all directory: "permission denied !" I don't understand where is the... (10 Replies)
Discussion started by: pascalbout
10 Replies

4. UNIX for Dummies Questions & Answers

create a file inside a directory

create a file inside a directory in one command like current directory is root i want to create a directory inside root and a file inside that directory is there any command like touch /d/d.txt d directory does not exist (1 Reply)
Discussion started by: abhisheklodha13
1 Replies

5. Homework & Coursework Questions

Create script to add user and create directory

first off let me introduce myself. My name is Eric and I am new to linux, I am taking an advanced linux administration class and we are tasked with creating a script to add new users that anyone can run, has to check for the existence of a directory. if the directory does not exist then it has... (12 Replies)
Discussion started by: pbhound
12 Replies

6. Solaris

Unable to create or delete a directory in /usr with root user

Hi All, I am trying to uninstall jdk 1.5 from my Solaris 10 64 bit but some how was not successful.so tried to delete the folder of jdk from /usr but its throughing error as: Unable to remove directory jdk: Read-only file system Even I tried to create a dir in /usr but its not allowing me... (4 Replies)
Discussion started by: Pshah
4 Replies

7. AIX

How to create a user as a root

please give me any suggestion, how can i create user as root privilege. (please give me very safest way because i have production servers) (5 Replies)
Discussion started by: reply.ravi
5 Replies

8. UNIX for Dummies Questions & Answers

Create user with sudo ability to root.

Hi All, I need to give an user sudo ability to root. We have also generated RSA key but unable to proceed further. For example after a user logs into the server normally and when he executes below command $ssh root@server_name This should take you to root prompt # Please help me.... (3 Replies)
Discussion started by: Rockyc3400
3 Replies

9. UNIX for Dummies Questions & Answers

How to create a file even root user also cant delete?

Is there any way to create a file in linux that root user also can't delete? (8 Replies)
Discussion started by: palani13dec
8 Replies

10. Solaris

SunOS confusing root directory and user home directory

Hello, I've just started using a Solaris machine with SunOS 5.10. After the machine is turned on, I open a Console window and at the prompt, if I execute a pwd command, it tells me I'm at my home directory (someone configured "myuser" as default user after init). ... (2 Replies)
Discussion started by: egyassun
2 Replies
MKDIR(2)						     Linux Programmer's Manual							  MKDIR(2)

NAME
mkdir - create a directory SYNOPSIS
#include <sys/stat.h> #include <sys/types.h> int mkdir(const char *pathname, mode_t mode); DESCRIPTION
mkdir attempts to create a directory named pathname. mode specifies the permissions to use. It is modified by the process's umask in the usual way: the permissions of the created file are (mode & ~umask). The newly created directory will be owned by the effective uid of the process. If the directory containing the file has the set group id bit set, or if the filesystem is mounted with BSD group semantics, the new directory will inherit the group ownership from its parent; oth- erwise it will be owned by the effective gid of the process. If the parent directory has the set group id bit set then so will the newly created directory. RETURN VALUE
mkdir returns zero on success, or -1 if an error occurred (in which case, errno is set appropriately). ERRORS
EPERM The filesystem containing pathname does not support the creation of directories. EEXIST pathname already exists (not necessarily as a directory). This includes the case where pathname is a symbolic link, dangling or not. EFAULT pathname points outside your accessible address space. EACCES The parent directory does not allow write permission to the process, or one of the directories in pathname did not allow search (execute) permission. ENAMETOOLONG pathname was too long. ENOENT A directory component in pathname does not exist or is a dangling symbolic link. ENOTDIR A component used as a directory in pathname is not, in fact, a directory. ENOMEM Insufficient kernel memory was available. EROFS pathname refers to a file on a read-only filesystem. ELOOP Too many symbolic links were encountered in resolving pathname. ENOSPC The device containing pathname has no room for the new directory. ENOSPC The new directory cannot be created because the user's disk quota is exhausted. CONFORMING TO
SVr4, POSIX, BSD, SYSV, X/OPEN. SVr4 documents additional EIO, EMULTIHOP and ENOLINK error conditions; POSIX.1 omits ELOOP. There are many infelicities in the protocol underlying NFS. Some of these affect mkdir. SEE ALSO
mkdir(1), chmod(2), mknod(2), mount(2), rmdir(2), stat(2), umask(2), unlink(2) Linux 1.0 1994-03-29 MKDIR(2)
All times are GMT -4. The time now is 11:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy