Script to eliminate files .rlogin


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to eliminate files .rlogin
# 8  
Old 06-24-2011
Hey there. I believe the script loop you presented can be quickly accomplished with two "find" commands ....
Code:
find /home -maxdepth 2 -name '.rhosts' | xargs mail -s "rhosts" root
find /home -maxdepth 2 -name '.rhosts' | xargs rm -f


Last edited by Franklin52; 06-28-2011 at 03:42 AM.. Reason: Please use code tags for code and data samples, thank you
# 9  
Old 06-24-2011
What about if root owns it and it is 444 and inside says "# Do not use .rhosts -- SysAdmin" Can the user rename it or change the permissions? My .rhost files were all owned by me, but I do recall permissions were critical.

Of course, everyone can have the same inode.

If you remove it, they can add it back. An ounce of prevention.
# 10  
Old 06-24-2011
Quote:
Originally Posted by DGPickett
What about if root owns it and it is 444 and inside says "# Do not use .rhosts -- SysAdmin" Can the user rename it or change the permissions?
They can do better than that, they can delete the thing, since that's controlled by directory permissions, not file permissions.
# 11  
Old 06-24-2011
And then the user cannot add a file to their home dir ?
# 12  
Old 06-24-2011
Quote:
What about if root owns it and it is 444
On most systems the .rhosts will not work at all unless the permissions are 600 (and owned by root or the particular user).
# 13  
Old 06-27-2011
Right, so to prevent, do not have 600, have 444 and root ownership so user cannot remove.
# 14  
Old 06-27-2011
Isn't there a command line option to rlogind to just disable .rhosts? My man page suggests -l does it.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help to eliminate the records

Hi All, Please help me how to remove the records from the file if it is having more number of fields than the required one, before loading into stage Here is the sample records. File is space delimited one chandu 1121324 CC ( 2 spaces) chandu balu 434657 DD (3 spaces) -- failing due to... (10 Replies)
Discussion started by: bbc17484
10 Replies

2. Shell Programming and Scripting

How to eliminate ^L

Hi, I am trying to create a text file from data retrieved from a query.The data retrieved is having this character '^L' at regular intervals of the data. How can i eliminate this, Please find below the sample data. I tried sed -e "s/\^L//g" to convert it, but with no luck ^LCODE*SERIAL... (11 Replies)
Discussion started by: ramkiran77
11 Replies

3. Shell Programming and Scripting

rlogin and script

I am writing a script to do rlogin to another system and execute commands on the remote system, i can successfully login to the remote system but the commands are not sent. i can only use rlogin to get to the remote system. what can i do? (6 Replies)
Discussion started by: aydj
6 Replies

4. Shell Programming and Scripting

script to eliminate left and right fields and to get the ouput.

Hi Experts, I have a file as given below and want to filter out the filenames in it , by deleting left and right filds and to have the fllenames (There are spaces in the filename), Sun Jan 11 11:20:10 2009 1 0 /home/output/file2311_recent.list user1 user2 0 done Sun Jan 11 11:20:10 2009 1 0... (10 Replies)
Discussion started by: rveri
10 Replies

5. Shell Programming and Scripting

Shell script help to eliminate files of todays date

Hi I am very new to shell scripting and have written a script (below). However the directory I am searching will contain a file with a .trn extension each day which I want to eliminate. Each day the file extension overnight will change to trx, if this fails I want to know. Basically what I... (2 Replies)
Discussion started by: richM
2 Replies

6. Shell Programming and Scripting

script for nested rlogin and telnet

I want to write a script that rlogins to a couple machines and then from the last machine, telnet into a final machine and execute a command. So in pseudocode it would look like: rlogin host1 from host1 rlogin host2 from host2 telnet host3 from host 3 execute command The reason for the... (6 Replies)
Discussion started by: mcburke38
6 Replies

7. Shell Programming and Scripting

rlogin inside a c-shell script

Hi Forumers, Sorry if it's really simple, but I couldn't find a way out. :( I've to do something like this in a script (csh): <some commands, variable settings, scripts> rlogin different_server <some commands, variable settings, scripts> After "rlogin", it shows the prompt of the... (5 Replies)
Discussion started by: sumitgarg
5 Replies

8. Shell Programming and Scripting

Eliminate variable checking in a script

RH Linux, $SHELL=/bin/ksh I have a .profile which I source in as such --> . .profile Whats happening is the variables are getting validated and generating errors. for example .profile export foo=/to/the/moon when I . .profile , I get : not foundmyusername/.profile or bad... (8 Replies)
Discussion started by: BMetelsky
8 Replies

9. Shell Programming and Scripting

How to Eliminate first line of multiple files

hi gurus ,, I have multiple files with same file pattern..in a particular directory for ex: file20061101.trf file20061102.trf file20061103.trf Each of the file has a header as column names.. My questions is how can i eliminate the first row of each of these... (11 Replies)
Discussion started by: sish78
11 Replies

10. Shell Programming and Scripting

rlogin from Shell script

I am logged into an AIX Unix box. From there I want to remotely login to remotely login to an HP-UX Unix box and want to execute a command that will create a file. I want to get the file to the AIX box. Can someon eplease advise how to automate that in a shell script? At the first step I want to... (2 Replies)
Discussion started by: asutoshch
2 Replies
Login or Register to Ask a Question