Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remote administration question

Status
Not open for further replies.
Mar 31, 2004
151
US
Could somebody please help me with this?

I was trying to connect to a remote system via ssh. When I run the script from my user account, ssh connects to remote system successfully. By doing this, I am able to execute remote commands.

As the cron is run under root, I tried running the same script as root, ssh asks for root password and does't automatically login as root. Now, this can't be done everytime and especially in my case I want my script to be automated.

Is there a solution to this problem? All I am doing is to avoid placing scripts on the other server.

Thanks in advance.


 
you could make the system with the scripts an nfs server.
you would then be able to have the client nfs mount the script directory and execute that way cron that way.


Thanks

Chris Adams
 
Take a look at sshd2_config

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks very much. I read about NFS setup and it is clear to me. However, the scripts perform a variety of functions such as database connections etc. Ex: script on server a will check for process on server b, check for timestamps in directories etc.. It appears to me NFS might not help in that case. Please suggest. Thanks.

 
Could you please tell in what caces PermitRootLogin of sshd2_config should be set to "YES"? Is my case a valid reason to do that?
 
Let me make sure I understand.
you have a server with scripts on system A, you want the scripts to reside on system A but execute on system b correct or false?

If true then I believe it should work but I am not a database person and really have not had a need to play with cron jobs to much.

Example.
I have nfs servers that I have disk firmware patches on. I have clients that have drives swapped in and out all the time so I need to update firmware constantly. Since the patches are updated frequently it is easier for me to keep the server updated and have the clients run the scripts off an nfs mount from the server. So what I have is a directory /dirves on my nfs server(test26) which is mounted by the client this way. cd /net/test26/drives; in this directory is the executables for the firmware scripts. I am on the client I cd to the nfs mount and execute the scripts which will run on the client.

I am not positive but if you set the cron job up on the client then it should run.

Sorry if I am wasting your time.

Thanks

CA


 
Thanks for the example.

> you have a server with scripts on system A, you want the scripts to reside on system A but execute on system b correct or false?

Yes that's right. Scripts on server a will execute on server a and remote servers b and c.

Therefore, with NFS, I positively assume I can create mount, have servers b&c crons cd to server a mountdir and run the scripts.What are the implications of NFS? Is this a valid reason to do NFS?

Thanks again.



 
One last question if you know this.

If we have servera.dir1 as nfs mount on server b, can we execute a script in that (servera.dir1 ) which will probe other directories in serverb?

What I mean is, let's say the script has something like this:

cd /tmp/logs etc ... will the script change directories on server b???



 
man chroot

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Ok. Could you please give a little bit of explanation? How will it be helpful in my case?
 
Questions;
One last question if you know this.

If we have servera.dir1 as nfs mount on server b, can we execute a script in that (servera.dir1 ) which will probe other directories in serverb?

What I mean is, let's say the script has something like this:

cd /tmp/logs etc ... will the script change directories on server b???


It would change directories on your client not the server. Again I am not a programmer so i am not sure how you would right the script to change the directories on the server and not the client. I would think this is possible just don't have the answer sorry. Maybe you could create a link within the nfs directory that would point to the directories you want read or put files to?

Thanks

Chris Adams

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top