CentOS 5 :: Script To Compare File To /etc/passwd?
Nov 10, 2009I have a list of locked accounts, called lockedusers, how can I with a bash script compare it to /etc/passwd on the server and print them out if they match?
View 2 RepliesI have a list of locked accounts, called lockedusers, how can I with a bash script compare it to /etc/passwd on the server and print them out if they match?
View 2 RepliesIs it possible to list/find/compare the program versions on a Centos system, against Redhat/Centos Errata/Security/Bug lists? Sort of looking for a way to make sure that all the packages on a system are ok, and not a security risk-- Without having to update every package. A pseudo code, in my mind is:
[Code]...
we know that /etc/passwd - is a replica of /etc/passwd file and acts as a backup in any damage done to /etc/passwd file..i have observed a strange thing in RHEL 5.4....for example... if /etc/passwd has 100 accounts.. then /etc/passwd - is having only 99 accounts....when i add 101 useraccount with "useradd" then /etc/passwd has 101 accounts and /etc/passwd is having the 100th account of /etc/passwd - ..when i delete /etc/passwd and recover it with /etc/passwd - from runlevel 1 the lastly created user is not having his account after recovery.. what is the solution? this is same case even with /etc/shadow and /etc/shadow -
View 2 Replies View RelatedI have a web server running Centos5 on a Xeon processor with 2GB of RAM. Whenever I try to login as a user the system hangs.If I login as root I can login without any problems. I tried changing the passwd. I can change the passwd but still not able to login as that user. I tried creating a new user. When I run the command adduser or useradd the system hangs.
View 7 Replies View RelatedA junior question: What is the use of /etc/passwd- & /etc/group-? Backups? I delete them, and they will come out again.
View 2 Replies View RelatedWell we all know that it holds passwords. But cat-ing it gives out nothing. Not even encrypted gibberish. So how exactly is a password stored in this? Is this like a device file or something?
View 4 Replies View RelatedI was doing some experiment about resource-accessing. By mistake, I executed this command,$ sudo mv /etc/passwd /etc/passwd.bakThen I could not execute any command with privilege(eg. sudo mv /etc/passwd.bak /etc/passwd). When I shut the system down, I could not boot it any more.
View 2 Replies View RelatedI got a user account on a linux network. But when I look in the /etc/passwd file, I don't see my username there. Where would I find my username
View 3 Replies View RelatedUnfortunately i lost my passwd file...so who to recover that.
View 8 Replies View RelatedI have a Debian 5.0.7 installed to my server. I try to install Apache and SVN to this server. I use this tutorial: http://www.howtoforge.com/subversion...-ubuntu-server
But is unfortunately not working.
My apache virtual host configuration file is:
Code:
This passwd file containing 1 user:
Code:
The rights for the passwd file:
Code:
And apache2 is running like this:
Code:
And if I try to login to my page I got an "Internal Server Error" page.
And my error is in the apache log is this:
Code:
So I'm a little bit confused about it. The apache2 should have rights to open this file. I checked it, the file is exist and the apache2 is have rights for it. I don't understand it.
documentation on the "stable" war-horse OSs. I am impressed for example on the community support of Ubuntu, Slackware, and impressed by the formal documentation of Arch and Gentoo.
1. However, how does the documentation of CentOS/RHEL compare to some of the other distros? and
2. How about compared to similar OSs, like Debian
I am trying to write a script which compares a log file with reference file. The log file has a table, the LHS of the table are constants strings and RHS of table values changes if there are any changes in configuration.code...
Here I am looking for a script which compares test.log file ( whose RHS data-types are known prior whether it is digit or string) with test.Ref which is reference file for test.log file. It will be really helpful for me if any of you give some idea about writing this script.
I got a file with a list of subnets like this:
10.50
10.51
10.62
10.121
then I cnf=`ifconfig` thus giving me the config of the NICs.after that I want to compare the $cnf to see if the value of it is listed in the file and if it is do things.There might also be something better to use then the 'ifconfig'but it worked so I just stuck to it First I just had one subnet but now it's starting to grow and I wanna make a list instead of having them all listed in the if-statement.
creating a script which evaluates whether or not the passwd file has changed.
View 4 Replies View RelatedI deleted root from passwd and shadow file.Can I crate a new root user?
View 1 Replies View RelatedI work for a seismic company that has recently experienced a security issue. Because we have an isolated network that is used for HPC work we have a very open security structue ie password less accounts rsh rlogin etc. We had, seemingly,a user that has maliciously deleted another user's files but I still haven't figured out how. So far I have been able to prove that this user has remotely logged into another host under that user's account... or at least that their workstation did. The /var/log/message file shows logins from their workstation as that user multiple times durring the times that these files were being deleted. There are wildcard searches for these files in the history in this host. There is a vi session initiated on this host for a file called delme (delete me) and then a chmod +x for this file. and then a deletion of this file (rm delme). Funny things: this user has no business in this acct. this user was bounced off the other host (permission denied) when trying to log into the other host and then as root logged into the other host as the other acct. repeatedly... ie. rsh -l xxx (permis den) then as root rsh -l xxx (logged in) why not su xxx and then rsh? password less acct?! why use root privs (which they sholuld not have) to log into a passwd less acct? Can't see any remote logins to their workstation from elsewhere. can't find smoking gun. no execution of delme script or any other rm /*/xxx/* sort of command that proves when file deletion of striped files happened?!
changing root passwd soon.need proof that no remote logins to a CentOS 5.3 workstation could be responsible.
Could mean someone gets fired.how can I be sure that no other users logged into this machine and then into another machine for sure?
What is the easiest way to replace a hash in a shadow file for one particular user, not using passwd, and when the current password is unknown?
View 3 Replies View RelatedHow do I compare the timestamp of two files? I tried this but it doesn't work:
file1time=`stat -c %Y fil1.txt`
file2time=`stat -c %Y file2.txt`
[code]....
I printed both the time stamps, in order and it gives me
1273143480
1254144394
./script.sh: line 13: [1273143480: command not found
So basically if comparision is not working, I guess. Or if there is any other nice way than what I am doing, please let me know.
Edit: There was no space in between if, so changing it to this works:
if [ $file1time -gt $file2time ]
I have many files with info about soft, installed on remote machines.
I need to compare this file with template (soft than must be installed) and output file must content info about software that's not installed.
Code:
Code:
output must be software_name2, becouse it is not installed, but software_name3.2 is good enough becouse version is more than we need.
So, the task is to show lines that is in template and not in source, using simple regular expressions
I use grep
Code:
or
Code:
But it shows me only lines that is in source and not in template etc...
I am trying to compare a list of patterns from one file and grep them against another file and print out only the unique patterns. Unfortunately these files are so large that they have yet to run to completion. Here's the command that I used:
Code: grep -L -f file_one.txt file_two.txt > output.output Here's some example data:
Code:
>FQ4HLCS01BMR4N
>FQ4HLCS01BZNV6
>FQ4HLCS01B40PB
>FQ4HLCS01BT43K
>FQ4HLCS01CB736
>FQ4HLCS01BU3UM
>FQ4HLCS01BBIFQ
how to increase efficiency or use another command?
Its 2 weeks i'm trying to configure freeradius2 on centos5 64bit after installed it from yum.all seems working, but i cant authenticate unix users.after digging in many sites its simply cant find user name and password ( ++[unix] returns notfound )Also how can i paste here all the radiusd -X log lines? i can't find any
radius.log file.
the last filed of /etc/passwd file is the login_shell;how if I replace it to /usr/bin/date
what would it happen.by the way I try to use $ subut do't know the password.what s the default root passworf for ubuntu
how to program in bash, an i have a problem, i am trying compare values in between 2 values (from another file), so far my solution is to make a nested for loop, but that causes it to compare every value. Here is a visulization of what i want
file.a 2,3,4,5
file.b
3 5
[code]...
i want the values 2, 3, 4, 5 from file.a to be compared inbetween values 3 5, 6 9,1 2, 4 7 from file.b (var1 is the value im comparing, var2 is the less value, var 3 is the greater value)
for i in $var1
do
for k in $var2
do
[code]....
my problem with the above code is it compares EVERYINNG, not the values inbetween what i want (which is 3 5, 6 9 etc).
I have a file like below
ADP_Comment- 4758
ADP_Comment-is missing
cbdkbckd- 46983
[code]...
when loggin as a normal user and search for a file passwd under /etc. i get few errors with permission denied.how to ignore this permission denied errors.
csh hostname 109 % find . -name passwd
find: ./lvm/backup: Permission denied
find: ./lvm/archive: Permission denied
[code]....
I have an internal hard drive and an external hard drive, both with about 350 GB of data. The data came from the same source, but over the last couple of years, different people have moved files around to different directories, and some files have been deleted. Now I want to merge all the files onto the internal hard drive. I estimate that 80% of the files on the external hard drive are the same, so I don't want to copy 290+ GB of data over when I already have it.
Therefore, I need a way to find just the files on the external hard drive that don't already exist on the internal one. In other words, I need to create two lists of file names irrespective of directories and compare them, selecting only the file names that exist in one list OR the other. I've Googled for solutions but can't find anything suitable. There are ways to create text files of the file names and compare them with diff, but they have to be in the same order, and since these files are in vastly different directories, that won't work.
i have just updated to openSuSE 11.4 [64 bit]; rkhunter is giving these Warnings :
Warning: User 'rtkit' has been added to the passwd file.
Warning: User 'pulse' has been added to the passwd file.
Warning: User 'statd' has been added to the passwd file.
Warning: Changes found in the group file for group 'audio': User 'pulse' has been added to the group
Warning: Group 'rtkit' has been added to the group file.
Warning: Group 'pulse' has been added to the group file.
Warning: Group 'pulse-access' has been added to the group file.
Warning: Suspicious file types found in /dev: /dev/shm/initrd_exports.sh: ASCII text
Warning: Hidden directory found: /dev/.sysconfig
Warning: Hidden directory found: /dev/.mount
Do these look Normal, Are these False-Positives??
I need to get names of all installed packages in 2 machines and save them in 2 text files, then I want to compare these 2 files to know the differences between 2 files and from that I could know the differences between 2 machines. Is it possible to do that and what program I could use?
View 2 Replies View RelatedI edited the passwd file to modify the default shell for root from bash to tcshnow when I try to login to root it gives me the following error:"su: /bin/tcsh : No such file or directory"
View 3 Replies View Related[Code]....
Password: su: /bin/bash:/sbin: No such file or directory i cannot delete that entry from /etc/passwd as i cannot login as root.