• Post Reply Bookmark Topic Watch Topic
  • New Topic

running my .csh script from a *different* machine, how to do it?  RSS feed

 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fellows,
I have created a .csh that does a backup of my database, generating a backup file (.dmp.gz) in "machine 1". It seems to work ok.
Now, since I don't want to keep that file in the same box, I want to be able to create a cron file in "machine 2" that will connect to "machine 1", run my .csh and copy the generated file across. The file is (won't) be that big, so size is not a problem for me.
the only connections that "machine 1" accepts is ssh. Any idea on how to do it? I have minimal knowledge on creating and registering the cron, that shouldn't be the problem. The problem is how to access "machine 1" without specifying password, etc..
any idas?
[ March 15, 2004: Message edited by: Andres Gonzalez ]
 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it has ssh, it should scp (secure copy) as well. Standard command is:
The only catch is that, you need to be able to put a password for scp to work (like ssh). The other way is by using RSA keys with pass phrase.
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Adrian. My solution is something like that (currently working on that):
I have to generate the keys so I can access ssh from a remote machine without specifying the password. I also need to make sure that the key is only allowed to run _that_ particular shell, nothing else (security reasons). it's something like adding a "command=myScript.csh" in the public key.
If i get that working it would be a matter of executing the shell and pipe that result into a file in my local machine. looks easy, but the ssh connections is giving me headaches.
thanks!
 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the key is only for one particular machine, it should be unique for everyone. After you generate the key, you can just copy it to the remote machine you want to access. You can use no passphrase to avoid typing in passwords. I'm not quit sure what you mean by that using only that shell?
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Adrian Yan:
Well, the key is only for one particular machine, it should be unique for everyone. After you generate the key, you can just copy it to the remote machine you want to access. You can use no passphrase to avoid typing in passwords. I'm not quit sure what you mean by that using only that shell?

agree with you. the thing is that when you put your public key in the other server, you have permissions to execute many things.
From what i've read, you can say something like:
for this user, with public key X, I'll only allow him to execute xxx.sh, and nothing else.
I set up the keys correctly, but when I was doing the Oracle command "exp" from the remote machine, I got an error that command not found. I think I was complicating myself.
What I end up doing was:
1) generate the backup
2) from that same machine, use scp command to transfer the backup file into another server (using the keys, so I don't have to type a passphrase). easy.
thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!