Sponsored Content
Full Discussion: UNIX/Linux User permisions
Top Forums Shell Programming and Scripting UNIX/Linux User permisions Post 302592559 by methyl on Tuesday 24th of January 2012 09:05:49 AM
Old 01-24-2012
Only the owner of the file (or root) can issue a chown.
If you are the owner and you issue a chown to another user, remember that after issuing the chown you will no longer own the file.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

file permisions 2000 to OSX

Could anyone tell me how or point me in the right direction on how to save files from a 2000box to a OSX server with the correct file permissions. File goes over and the only person that has r/w permissions is the owner everyone else is read only. HELP!!! (2 Replies)
Discussion started by: mom
2 Replies

2. UNIX for Advanced & Expert Users

Access permisions issue for directories

I am getting the different accessing permissions for the directories ,for some directories it is drwxr-sr-x, for some other directories it is like drwxr-xr-x. what is the difference between these 2 access permisions of the directories? (1 Reply)
Discussion started by: bishnu.bhatta
1 Replies

3. UNIX for Dummies Questions & Answers

Difference between : Locked User Account & Disabled User Accounts in Linux ?

Thanks AVKlinux (3 Replies)
Discussion started by: avklinux
3 Replies

4. Shell Programming and Scripting

Management application user rights on the files in a Unix / Linux

good evening .. I have a plea, who I can help me with a management application user rights on the files in a Unix / Linux I need for college .. .. and not told us no clue .. thank you (1 Reply)
Discussion started by: alex90
1 Replies

5. Shell Programming and Scripting

How to change passwords for User accounts on multiple UNIX/Linux machines remotely?

Hello Experts, Need some direction on creating shell script for following environment: We have about 20 people in the team working as Oracle DBA's (sysdba's and appdba's). Total Servers which is a mix of Unix and Linux are 200. We do not have Root user access on any of the servers and... (3 Replies)
Discussion started by: sha2402
3 Replies

6. UNIX for Dummies Questions & Answers

Best way for central user managet UNIX/Linux/win?

Hey there, I want to centralize my user managet in the next days, at first i want only centralize the user from my local network and later also from my servers. So I started looking around what I could use for this and only found openLDAP. I want to manage users for linux, OSX and Windows (if... (3 Replies)
Discussion started by: dryPants
3 Replies

7. Red Hat

SFTP User creation in Redhat Linux/UNIX

SFTP user creation step… Create a group # groupadd sftp_users If the users doesn’t exist on system , use below command : # useradd -G sftp_users -s /sbin/nologin username # passwd username For already existing users , use below usermod command : # usermod –G... (1 Reply)
Discussion started by: taherahmed
1 Replies

8. Shell Programming and Scripting

How to enforce user to Enter text when login to a UNIX / Linux system?

Hi. I inject my tracklogin.sh script in the profile of each user. $ more .profile ./tracklogin.sh # This is the default standard profile provided to a user. MAIL=/usr/mail/${LOGNAME:?} bash-3.2$ more tracklogin.sh #!/bin/bash tdate=$(date +"%d%m%y") mkdir -p /tmp/root_log... (20 Replies)
Discussion started by: mohtashims
20 Replies

9. UNIX for Advanced & Expert Users

Pam.d and make difference between AD User and local user on Linux

Hello, i configured rhel linux 6 with AD directory to authorize windows users to connect on the system and it works. i have accounts with high privileges (oracle for example) if an account is created on the AD server i would to block him. I looked for how to do, for the moment all the... (3 Replies)
Discussion started by: vincenzo
3 Replies
chown(2)							System Calls Manual							  chown(2)

NAME
chown, lchown, fchown - Changes the owner and group IDs of a file SYNOPSIS
#include <unistd.h> int chown( const char *path, uid_t owner, gid_t group ); int lchown( const char *path, uid_t owner, gid_t group ); int fchown( int filedes, uid_t owner, gid_t group ); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: chown(): POSIX.1, XPG4, XPG4-UNIX fchown(): POSIX.1, XPG4-UNIX lchown(): POSIX.1, XPG4-UNIX Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Specifies the name of the file whose owner ID, group ID, or both are to be changed. When the path parameter refers to a symbolic link, the behaviors of the chown() and the lchown() functions differ. The chown() function changes the ownership of the file pointed to by the sym- bolic link. The lchown() function changes the ownership of the symbolic link file itself. Specifies a valid open file descriptor. Speci- fies a numeric value representing the owner ID. Specifies a numeric value representing the group ID. DESCRIPTION
The chown(), lchown() and fchown() functions change the owner and group of a file. A process can change the value of the owner ID of a file only if the process has superuser privilege. A process can change the value of the file group ID if the effective user ID of the process matches the owner ID of the file, or if the process has superuser privilege. A process without superuser privilege can change the group ID of a file only to the value of its effective group ID or to a value in its sup- plementary group list. If the value of the owner ID is changed and the process does not have superuser privilege, the set-user ID attribute (the S_ISUID bit) of a regular file is cleared. The set-user ID attribute (S_ISUID bit) of a file is cleared upon successful return if: The file is a regular file. The process does not have superuser privilege. The set-group ID attribute (S_ISGID bit) of a file is cleared upon successful return if: The file is a regular file. The process does not have superuser privilege. If the owner or group parameter is specified as (uid_t)-1 or (gid_t)-1 respectively, the corresponding ID of the file is unchanged. Upon successful completion, the chown(), lchown(), and fchown() functions mark the st_ctime field of the file for update. RETURN VALUES
Upon successful completion, the chown(), lchown(), and fchown() functions return a value of 0 (zero). Otherwise, a value of -1 is returned, the owner and group of the file remain unchanged, and errno is set to indicate the error. ERRORS
If the chown() and lchown() functions fail, errno may be set to one of the following values: Search permission is denied on a component of path. The path parameter is an invalid address. The owner or group ID is not a value supported by this implementation. Too many links were encountered in translating path. The length of the path argument exceeds PATH_MAX or a pathname component is longer than NAME_MAX. The path parameter does not exist or is an empty string. A component of path is not a directory. The effective user ID does not match the ID of the owner of the file, and the calling process does not have appropriate privilege and _POSIX_CHOWN_RESTRICTED indicates that such privilege is required. The named file resides on a read-only file system. The process' root or current directory is located in a virtual file system that has been unmounted. If the fchown() function fails, errno may be set to one of the following values: The file descriptor filedes is not valid. The owner or group ID is not a value supported by this implementation. RELATED INFORMATION
Functions: chmod(2) Commands: chown(1) Standards: standards(5) delim off chown(2)
All times are GMT -4. The time now is 08:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy