• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 485
  • Last Modified:

Create a script to add an .rhost entry remotely

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
heavenlydishes
Asked:
heavenlydishes
1 Solution
 
NovaDenizenCommented:
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
 
koppchaCommented:
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
 
ahoffmannCommented:
beside the security issues about .rhosts ...

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

# same for rsh instead of ssh
0
 
XoFCommented:
rsh -l user remotehost echo whatever ">>" /path/to/.rhosts

just my 0.02€...;)

-XoF-
0
 
heavenlydishesAuthor Commented:
Thanks for the comments all! ahoffman's worked for me.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

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

Tackle projects and never again get stuck behind a technical roadblock.
Join Now