Sponsored Content
Operating Systems HP-UX owner Permission changed automatically Post 302596837 by methyl on Wednesday 8th of February 2012 11:37:18 AM
Old 02-08-2012
Finally managed to read the .jpg examples.

The issue is with these commands. I've posted them as comments
because we don't want people executing them.
Code:
# bad line 1 # vi /etc/passwd
# bad line 2 # cp -rf /etc/skel/.* /home/selva/
# bad line 3 # chmod -R selva:users /home/selva/.*
# bad line 4 # chown -R selva:users /home/selva/.*

1) NEVER use "vi" on /etc/passwd. If you are expert, use the "vipw" command, but in your case you probably just needed "view".

2) This command is terrifying. Try this to see what I mean:
ls /etc/skel/.*
Compared with:
ls /etc/skel/.??*

3) This command is a syntax error and didn't do anything.

4) This command is terrifying. Try this to see what I mean:
ls /home/selva/.*
Compared with:
ls /home/selva/.??*

The problem is your use of ".*" when you expected it to match filenames starting with a "." . It actually expanded the the parent directory "." in both occasions. Your problem was made so much worse by using recursive (-r/-R) and overwrite (-f) options to commands when there was no point in that context.
It should be possible to use the "ls" commands I posted above to determine which files were copied or changed in error. However because you used the "-f" switch to "cp" be careful about detecting files which were overwritten (if any).
It's such a mess that it may be quicker to go back to backup, but it depends on how many files you had in /home and whether all permissions are easy to fix.

The change of permissions of some files in /usr /var /opt will be because many of the original files in /etc are LINKS and having copied the lot to /home/selva your commands then issue a recursive "chown" on the copies. Scary. I'm surprised that this system is still running, but don't reboot the system without repairing all the permissions of system files.

QED.

Last edited by methyl; 02-08-2012 at 01:02 PM.. Reason: typos (lots)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

permission, owner and group

hello I search a script (ksh for Aix 5.3) to save all permissions, groups and owner for all files. Because we work much to change it, and a mystake ......! So i want execute this script to save/ execute permissions for all files. If you have this script, thank you for your help ;) best... (2 Replies)
Discussion started by: pascalbout
2 Replies

2. Linux

How to changed Permission on Tape

I am unable to backup file on my tape drive # mt -f /dev/st0 status SCSI 2 tape drive: File number=0, block number=0, partition=0. Tape block size 0 bytes. Density code 0x25 (DDS-3). Soft error count since last status=0 General status bits on (45010000): BOT WR_PROT ONLINE IM_REP_EN #... (6 Replies)
Discussion started by: real-chess
6 Replies

3. Programming

how I know owner of file and its permission through c program

Helo I havea particular file. how I know ownerof the file as well as file permission using c program. Regards, Amit (4 Replies)
Discussion started by: amitpansuria
4 Replies

4. Shell Programming and Scripting

automatically change owner and group

We have a program that when a new account is created using the webpage it creates a new directory on the linux filesystem for the account. The problem is the process that creates the directory is as root user, as I want ftpuser to be able to login I have to manually login and chown -R the... (1 Reply)
Discussion started by: borderblaster
1 Replies

5. UNIX for Advanced & Expert Users

Permission denied, but user is owner and has group ownership too

Folks, I have a problem with a particular file, that seems to have some kind of lock on it, that takes around 1 hour approx to timeout. I have used lsof and nothing has an open file handle on it, yet I cannot open it. My user/group owns the file and I can create edit/delete files in... (6 Replies)
Discussion started by: scottrus
6 Replies

6. Shell Programming and Scripting

search files with owner having execute permission

Hi All, I have to search for all files in the current directory where the owner having execute operation. I can find the files with specific permission such as 666 find . -type f -perm 666 But how to find files with only execute permission to user. tried with : find . -type f... (3 Replies)
Discussion started by: gotam
3 Replies

7. Solaris

setfacl don't change permission on group owner

I try to use setfacl command to change the permission of the group primary it does not accept the command , it really accept but don't change the permission on the group. the point here I read that if I use chmod command on group primary the mask changed, but if I use setfacl mask should not... (0 Replies)
Discussion started by: hard_revenge
0 Replies

8. AIX

Syslogs permission not getting changed - aix 6.1

Friends, I've tried to modify the syslogs permission by using the perm option in the syslog configuration in AIX 6.1 TL 05. But its not getting applied after the configuration. Have restarted the syslog service also. Need your help!:wall: The below are the conf details and os versions >... (1 Reply)
Discussion started by: novaothers
1 Replies

9. Linux

Mount point permission was changed

Hello everybody, I have many mount points on my virtual Redhat server, two of them lost their (write) permission, so they became read-only filesystems. I fixed this problem. But I want to know why it happened? What is the reason behind that to avoid it again? Where can I find related logs?... (2 Replies)
Discussion started by: Mohannad
2 Replies

10. Red Hat

/dev/dm-? owner changed.

After reboot of redhat 6 server , the owner of /dev/dm-? changed, causing the oracle disk group to show insufficient no of disk. how to identify which dm-? owner is changed.? (2 Replies)
Discussion started by: shivdeep77
2 Replies
SSS_USERADD(8)							 SSSD Manual pages						    SSS_USERADD(8)

NAME
sss_useradd - create a new user SYNOPSIS
sss_useradd [options] LOGIN DESCRIPTION
sss_useradd creates a new user account using the values specified on the command line plus the default values from the system. OPTIONS
-u,--uid UID Set the UID of the user to the value of UID. If not given, it is chosen automatically. -c,--gecos COMMENT Any text string describing the user. Often used as the field for the user's full name. -h,--home HOME_DIR The home directory of the user account. The default is to append the LOGIN name to /home and use that as the home directory. The base that is prepended before LOGIN is tunable with "user_defaults/baseDirectory" setting in sssd.conf. -s,--shell SHELL The user's login shell. The default is currently /bin/bash. The default can be changed with "user_defaults/defaultShell" setting in sssd.conf. -G,--groups GROUPS A list of existing groups this user is also a member of. -m,--create-home Create the user's home directory if it does not exist. The files and directories contained in the skeleton directory (which can be defined with the -k option or in the config file) will be copied to the home directory. -M,--no-create-home Do not create the user's home directory. Overrides configuration settings. -k,--skel SKELDIR The skeleton directory, which contains files and directories to be copied in the user's home directory, when the home directory is created by sss_useradd. This option is only valid if the -m (or --create-home) option is specified, or creation of home directories is set to TRUE in the configuration. -Z,--selinux-user SELINUX_USER The SELinux user for the user's login. If not specified, the system default will be used. -h,--help Display help message and exit. THE LOCAL DOMAIN
In order to function correctly, a domain with "id_provider=local" must be created and the SSSD must be running. The administrator might want to use the SSSD local users instead of traditional UNIX users in cases where the group nesting (see sss_groupadd(8)) is needed. The local users are also useful for testing and development of the SSSD without having to deploy a full remote server. The sss_user* and sss_group* tools use a local LDB storage to store users and groups. SEE ALSO
sss_groupadd(8), sss_groupdel(8), sss_groupshow(8), sss_groupmod(8), sss_userdel(8), sss_usermod(8). AUTHORS
The SSSD upstream - http://fedorahosted.org/sssd SSSD
03/04/2013 SSS_USERADD(8)
All times are GMT -4. The time now is 11:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy