Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ssh script

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
Ghost
Guest





PostPosted: Thu Jun 23, 2005 2:22 pm    Post subject: ssh script Reply with quote

Hey guys Very Happy

I'm in need of a litle help, and not too sure if here is the right place to ask so...

I'm using Mac OS X 10.4.1 and im trying to make a script that will ssh into my clarkconect box which in turn will run another script.

I would like this script to be able to leave a log of the entire prossece errors and all on my mac.

As this is the first time ive had to do some thing like this i was kinnda hope you Linux/*nix gurus would know this one i did try google first but came up with automated linux install's ?

thanks
Back to top
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Thu Jun 23, 2005 2:55 pm    Post subject: RE: ssh script Reply with quote

Not sure about the Mac-specifics, but

Code:
ssh hostname script >>script.log


will run "script" on "hostname" and send the output to a logfile in the current directory. The redirection takes place in the current shell, you are logging the output of the ssh command, which in turn is the output of the command it runs, so all you need to do is have your script on the clarkconnect box send its output to stdout.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
Guest






PostPosted: Thu Jun 23, 2005 3:48 pm    Post subject: RE: ssh script Reply with quote

Ok, that did not work Sad, i can ssh into the Linux box with out the password, now all i need is a mac os x script that will run ssh the run the script on the linux box then leave a log on the mac box ???
Back to top
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Thu Jun 23, 2005 6:23 pm    Post subject: RE: ssh script Reply with quote

What does "that did not work" mean? What did you do? What did you expect to happen? What happened?I know it works with Linux to Linux, I did exactly that less than an hour before you asked.

Code:
ssh hostname command


runs command on hostname, but all output goes to stdout on the local box, so you only need redirection to log it.

I think you really need to give some more specific information, rather than vague references to unknown scripts and no error messages.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
skecs



Joined: Fri Apr 22, 2005 10:22 am
Posts: 76
Location: Bathurst, NSW Australia

PostPosted: Sat Jun 25, 2005 7:18 am    Post subject: RE: ssh script Reply with quote

Firstly, have you enabled remote login? It is disabled by default, to enable go to the Sharing Pane in System Preferences.

Secondly, if you have enable File Vault the home folders must be mounted to access them. In other words you need that user to be logged in or you can't access those directories.

You can connect from a terminal using another Mac OS X, so you should be able to using a terminal on Linux.
_________________
Regards from
Downunder!
.... _
... (0)>
... / /\
.. / / .)
.. V_/_
Linux Powered!
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast