Connect to another Mac via Terminal?

5

4

I need to connect to a Mac server from my MacBook using Terminal.app. If I open Finder, I can see it in my "SHARED" list. I can "connect as" an authenticated user and all that.

But how do I connect to the same machine from the Terminal? I don't know its IP address, just know it's name.

Thanks

mark

Posted 2010-11-24T20:52:44.820

Reputation: 91

Answers

10

ssh computer_name

You'll need to turn on Remote Login in the Sharing Prefs Pane of the computer you want to connect to.

user31752

Posted 2010-11-24T20:52:44.820

Reputation:

5

First, you need to have remote command-line login (with the SSH protocol) enabled on other computer -- open System Preferences -> Sharing, and enable Remote Login (also, make sure the Allow access for: option enables the account you want to log into).

To make the connection, run Terminal, and use the command ssh remoteuser@remoteBonjourName.local, where remoteBonjourName.local is the computer name of the other machine with most punctuation removed, spaces converted to "-", and ".local" added to the end (check its Sharing prefs, right under the Computer Name)

Alternately, you can use Terminal's New Remote Connection option (under the Shell menu), select Secure Shell (SSH) from the Service list, and it should show all Macs running SSH on the right side. Select the one you want to connect to, enter the user you want to log in as in the User field, and click Connect.

Gordon Davisson

Posted 2010-11-24T20:52:44.820

Reputation: 28 538

4

  1. Select Go > Applications then Utilities > Terminal.
  2. Do one of the following: • Mac OS X 10.4 - select File > Connect to Server. • Mac OS X 10.5 - select Shell > New Remote Connection
  3. Under Service, select Secure Shell (ssh).
  4. Under Server click the plus sign. You are prompted to "Enter the name or IP address of a server...". Type the name or address for the host server that you want to access (e.g., unix.andrew.cmu.edu). Click OK. Note: This server address will now appear in the Server list. The next time you wish to connect, you can select it from the list.
  5. Type your andrew UserID in the User text box.
  6. Select SSH Protocol 2 from the drop-down list. (selecting "SSH Automatic" from this list will also work.)
  7. Select the server address from the drop-down list. The server address will appear as ssh-2 userid@host server address Where userid is your Andrew userID and host server address is the address of the host server you are trying to connect to. In our example, the server address appears as: ssh-2 userid@unix.andrew.cmu.edu.
  8. Click Connect.

Hope that will help you

Sagar Khetia

Posted 2010-11-24T20:52:44.820

Reputation: 128

0

First, you need to become the root user by typing dsenableroot.

Your computer will ask for the user password, and the root password.

Make sure the computer you are trying to get into has "remote management, and remote login" in the Sharing settings in the System Preferences turn on.

Then type: ssh username@internal ip address.

Now any command you type in while signed into their ssh will happen on their computer.

For example:

sudo shutdown -h now

le Pro

Posted 2010-11-24T20:52:44.820

Reputation: 1