Open a terminal on a remote computer

sshterminal

I want to open a terminal and run a command on a remote computer through SSH. I don’t need to see what is happening in that terminal, but I cannot make it work.

I know to open a browser, for example Chrome, and open to a website it would be:

ssh ssh@login -a “http://www.websitehere.com”

Is there an equivalent for Terminal?

Best Answer

I think you're just confusing some of the concepts here. When you SSH to another computer you're connecting to it in an interactive terminal. You can run commands logged into another computer through this SSH connection.

Example

Here I'm logged into my Macbook (unagi) as myself (smingolelli).

$ hostname
unagi

$ whoami
smingolelli

Now we SSH to another computer on my LAN (mulder) as another user that's local to that system (root).

$ ssh mulder.bub.lan -l root
Last login: Sun Apr 21 23:05:32 2019 from 192.168.1.95

$ hostname
mulder.bub.lan

When I'm done I simply exit this interactive SSH connection to another host and I'm back on my original Macbook host.

$ exit