We had created new user using the command useradd -d /home/selva -s /usr/local/bin/bash selva. But it didnt created the home directory on /home. So i manually created, copied skel files manually and changed the owner from root to selva. At the same time i observed that so many files copied from /etc to /home directory on the same time and some files owners are showing as selva.
Fully I am confused...I have attached files which was created automatically in /home and see the owners and my history file.
For that only I did manually...but why should unwanted files copied from /etc/ to /home. and also owners of all users home directory changed to selva as owner. and some /usr/, /var/, /opt files also got changed...What will be the reason behind...?
So i manually created, copied skel files manually and changed the owner from root to selva. At the same time i observed that so many files copied from /etc to /home directory on the same time and some files owners are showing as selva.
We assume that you were logged in as "root" and typed one of more commands incorrectly which caused unexpected change to the system.
What did you actually type?
(If you have a .sh_history file , have a look at it with the "strings" command).
Ps. I can't read your ".jpg" attachments. Can you post in text?
When u missed -m option then -d /homepath get updated in /etc/passwd file ... but dir /homepath will not get created that had happend at your case ... and you had created that dir after and copied that files from skel dir right ...
Better recreate the user ... with right parameters ...
The issue is with these commands. I've posted them as comments
because we don't want people executing them.
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)