7

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

5 Answers 5

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.

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 [email protected], 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.

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 [email protected].
  8. Click Connect.

Hope that will help you

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
0

Prerequisite:

1.Have ssh installed

2.Remote Login setup

System Preferences -> Sharing -> Enable "Remote Login"

Remote Login

ref:https://support.apple.com/guide/mac-help/allow-a-remote-computer-to-access-your-mac-mchlp1066/mac

Access:

ssh user_name@host_name

user_name:

Whatever under "Allow access for" in the above image

host_name:

a. under "Computer Name" in the above image (You can edit it)

b. in the terminal

ifconfig | grep "inet " | grep -v 127.0.0.1
Output: inet 192.168.1.XXX netmask 0xffffff00 broadcast 192.168.XXX.255

For example,

ssh [email protected] OR
ssh [email protected]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .