Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Create a script to add an .rhost entry remotely

Posted on 2005-04-22
5
Medium Priority
?
483 Views
Last Modified: 2010-04-21
I want to create a script that connects to a remote server and adds an entry to the .rhost file. How do you modify a file on a remote host?
0
Comment
Question by:heavenlydishes
5 Comments
 
LVL 22

Expert Comment

by:NovaDenizen
ID: 13845149
Anything that uses .rhost is so insecure you probably shouldn't be using it.  Reconsider.  Look at the big picture and redesign your system so that it instead uses public keys and ssh or some other modern remote access tool.
0
 
LVL 8

Expert Comment

by:koppcha
ID: 13845290
you can do this in the script

1>Connect to remote machine using atuomatic ftp
2>take a back up of the .rhost file in the remote machine
3>copy new .rhost file

If you want to add a line you can use the command i specified in your eariler question to add a line
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 2000 total points
ID: 13852914
beside the security issues about .rhosts ...

ssh user@remotehost 'echo whatever >> /path/to/.rhosts'

# same for rsh instead of ssh
0
 
LVL 7

Expert Comment

by:XoF
ID: 13864683
rsh -l user remotehost echo whatever ">>" /path/to/.rhosts

just my 0.02€...;)

-XoF-
0
 

Author Comment

by:heavenlydishes
ID: 13908283
Thanks for the comments all! ahoffman's worked for me.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question