LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 01-21-2007, 08:51 AM   #1
tantan
LQ Newbie
 
Registered: May 2006
Location: Italy
Distribution: RedHat
Posts: 13

Rep: Reputation: 0
schedule ssh from Windows to Linux


Hi,
I'm trying to schedule a script hosted on a linux machine from a windows server, using ssh. I generated the keys and accomplished all the stuff related. Then I wrote a batch on Windows where I put the ssh command to remotely lounch the script on linux. When I manually lounch that batch from Windows, all works fine. But if I logout and try to schedule the execution of the same batch, it doesn't work. It seem (I only guess, but I'm not shure) ssh is not able to authenticate (note that I put attention in executing and scheduling the batch with the proper, and same, user). Neither I'm able to obtain a log by redirecting the output of the batch in a file. The file is created but empty.
Any idea?
 
Old 01-21-2007, 09:59 AM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Bit confused about your question but sounds like you may need to use an addtional app that has the keys ready for the next login. Check out ssh-agent and see if that helps.

Post the contents of your script.

Brian
 
Old 01-24-2007, 01:31 AM   #3
jantman
Member
 
Registered: Nov 2005
Location: New Jersey, USA
Distribution: SuSE
Posts: 492

Rep: Reputation: 31
I'm not sure where you're really going with this...

What is the end result that you want? What is this script doing?

Is this something that can be accomplished with a cron job on the Linux machine?
 
Old 01-26-2007, 06:59 AM   #4
tantan
LQ Newbie
 
Registered: May 2006
Location: Italy
Distribution: RedHat
Posts: 13

Original Poster
Rep: Reputation: 0
problem solved

Hi,
finally I solved the problem.
Just to be clear, my problem was to schedule a shall script from another host. Doesn't matter what the script do, whatever it do, the failure wasn't it does not work properly, but that it is not launched from remote, it does not start because the remote scheduler don't succeed to authenticate with ssh. I'know I could schedule it locally, but my need is to schedule it remotely by another application (CA unicenter TNG).
Well, I found the problem, and it was in the DOS batch.
When I manually launch the batch, it authenticates because I'm logged in, and ssh can read the environment variables that say it where find it's key. When I schedule it, also if I schedule the execution with the same user I use to login, for some reason ssh does not succeed to read his variables.
I don't know why, but the problem was this:
I set te variables in the batch using commands like
SET HOME=C:\docume~1\"home of the user"
SET HOMEPATH=C:\docume~1\"home of the user"
SET USERNAME="name of the user"
ssh.exe ......

Someone told me to write this way instead:

@SET HOME=C:\docume~1\"home of the user"
@SET HOMEPATH=C:\docume~1\"home of the user"
@SET USERNAME="name of the user"
ssh.exe ......

Note the "@" symbol before the "SET"

I don't really know what it means in DOS but work!!!

regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux user login schedule sem007 Linux - Enterprise 1 12-23-2006 05:07 AM
Can't ssh from linux, but can from windows? Rotwang Linux - General 10 05-05-2006 03:40 PM
Dual boot Linux with Windows AS PER TIME SCHEDULE bestguy Linux - General 3 02-13-2006 01:43 PM
SSH from windows to linux not working hamish Linux - Software 7 12-08-2004 02:56 PM
ssh windows to linux Longinus Linux - Networking 3 04-18-2004 10:44 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 08:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration