PDA

View Full Version : Ssh?


BinarySpike
2005.06.01, 05:28 PM
I was wondering if SSH could launch applications? (not .apps, the thing in Contents/MacOS/)


Is there any good tutorial or info I can find out about SSH?
(like how to use it :blush:?)


ThankS!

OneSadCookie
2005.06.01, 05:51 PM
man ssh

(more characters)

LongJumper
2005.06.01, 05:55 PM
SSH is just a secure way to connect to another computer as a user. It's typically used for remote-access and file transfer. While you can run applications directly from the terminal on another computer, you will only be able to see print outs to the console, since I don't think terminal has access to creating new windows and doing OpenGL and other things like that. You can also run applications like emacs if they are on the host machine.

So, I don't know what you're trying to do with it, you may want to explain what you mean by launching an application.

BinarySpike
2005.06.01, 07:05 PM
Well, there's a game called bzflag that has a server program.
(It's open-source so I added some cool features to it... like no death on capture of flag)


Most servers you need a graphical interface to run the app.
(through command line...)


So, I was just wondering if SSH could start the server.
(And I guess I can't...)


While you can run applications directly from the terminal on another computer

How?
Could it be done if I have ftp access?

(My friend is using his computer for a server and he gave me an acount... how would I start it?)

Duane
2005.06.01, 07:11 PM
no
FTP is to transfer files... (File Transfer Protocol). You might want to try Remote Desktop.

geezusfreeek
2005.06.01, 09:28 PM
I don't really see why you couldn't start it in an SSH session....

BinarySpike
2005.06.01, 09:37 PM
Ok, so how do I start an app in terminal?

PowerMacX
2005.06.01, 11:25 PM
Ok, so how do I start an app in terminal?

Connect using ssh, and after you log in:
./SomeGame.app/Contents/MacOS/SomeGame

You could also use VNC (http://www.google.com/search?client=safari&rls=en&q=vnc+mac+os+x&ie=UTF-8&oe=UTF-8) (over ssh if you want).

BinarySpike
2005.06.02, 12:02 AM
Ahah!

So it does use SSH!

Can I do it withought SSH?
(Like http:/somename.com/something/whatever.app/contents/MacOS/)

Assuming of course that the server is mac...

NCarter
2005.06.02, 04:11 AM
You can use the open command to launch things with the Finder. For example:

open /Applications/Calculator.app
This works on anything that could conceivably be opened by the Finder: applications, documents, folders. You can also use the -a option to specify which application you'd like to use to open a generic data file. I believe the open command is Mac/NextStep specific, so don't expect it to work on other platforms.

As usual, type 'man open' into the Terminal to read about its options.

Once you've got an application open, you can control it by using the osascript command to send AppleScript code to it - that's sometimes quite useful if you're trying to remote control a program on another machine. Again, read 'man osascript' for details.

Can I do it withought SSH?
(Like http:/somename.com/something/whatever.app/contents/MacOS/)
I'm not aware of any realistic way you can construct a clickable URL which would execute a command via ssh.

geezusfreeek
2005.06.02, 04:13 PM
I bet you could make, say, a Perl script (with loose permissions and very careful coding due to said permissions) that can be executed from Apache and runs the appropriate commands to start the application.

Steven
2005.06.02, 09:36 PM
But of course this allows anyone to run this application. Probably not a good idea - or at least set it up to be https:// and password-protected...

Dan Potter
2005.06.03, 12:16 AM
I'd also think that you wouldn't be able to start a graphical .app from an ssh session unless you already were logged into the console locally. Otherwise what would AppKit connect to, in order to display its visuals? It shouldn't let you arbitrarily connect with the current window manager service, or you could do nasty things to other users when you have fast user switching turned on. :) On Unix with X11 you'd just get a "cannot connect to display" error... I suspect OSX does something similar.

Steven
2005.06.03, 12:36 AM
Yeah, you have to be logged in otherwise it can't connect to the display server ;)

geezusfreeek
2005.06.03, 01:16 AM
Nope. I used to nag my sister by logging into the iMac while she was using it and making little text documents pop up in her face using the open command.

BinarySpike
2005.06.03, 02:04 PM
:lol:

I can't do that because I only have one OS X. :cry:



Ok, so is there an application like terminal (that has the open command) for mac os 9?
Like MacSSH?

BinarySpike
2005.06.03, 03:24 PM
Sweet!


I logged in as my short name.
(using MacSSH)

I then did this command:
cd ../..
sudo open something.rtf

(without sudo if the current signed in user is not you then you will get errors)

It will open somthing.rtf on your HD.
YourHD/somthing.rtf


Cheers!

Dan Potter
2005.06.04, 03:09 AM
Nope. I used to nag my sister by logging into the iMac while she was using it and making little text documents pop up in her face using the open command.

Ssh'd to my wife's computer as me, with her logged in on the console:

$ open foo.pdf
kCGErrorRangeCheck : Window Server communications from outside of session allowed for root and console user only
INIT_Processeses(), could not establish the default connection to the WindowServer.Abort trap


So no, in Panther at least it won't work unless you're logged in on the console or are root. Perhaps you were both using the same user account...