beautypg.com

Executing commands in an ssh session, Closing an ssh session, Understanding key fingerprints – Apple Mac OS X Server (Administrator’s Guide) User Manual

Page 554

background image

554

Chapter 17

2

At the prompt, type ssh, then a hyphen, the flag “l” (lower case L, for “login”) followed by the
user name of an administrator of the remote server and the server’s IP address or host name.
Press Return when you’re finished (for example, “ssh -l jsmith 192.168.100.100”).

If you’re not sure of the administrator’s name, you can also type “ssh
[email protected]”.

If you don’t enter an administrator name (or “admin”), SSH will use the user name of the
person currently logged in to the computer you are using. If this user doesn’t have
administrator access to the server, you must enter the appropriate administrator name.

3

At the prompt, type the administrator password and press Return.

If everything is entered correctly, the prompt identifies the remote server (for example,
[192.168.100.100:~] jsmith%”).

If you started the remote server up from a CD and logged in as root, you will see a number
sign (#) instead of the remote server identifier.

Executing Commands in an SSH Session

Once you are logged in using SSH, you can use command-line tools to execute commands
on the remote server.

If you want to execute a single command on the server and then immediately log out of
the server, you can do it in one step. Type your login information and the command, then
press Return.

For example, the command to log in to a remote server and remove a file called “Test Data”
looks like this: “ssh -l root 192.168.100.100 rm "/Documents/Test Data"”. The server asks for
the password, and then executes the command.

Closing an SSH Session

When you have finished with a SSH session, you should close the session, especially if you
are logged in as the root administrator with root privileges, so that no one else can make
changes on the server. To log out, simply type “exit”, then press Return.

Understanding Key Fingerprints

The first time you log in to a server using SSH, your local computer adds a “fingerprint” from
the remote server to a list of known remote host computers and displays a message:

The authenticity of host ‘192.168.12.12’ can’t be established.

RSA key fingerprint is a8:0d:27:63:74:00:f1:04:bd:6a:e4:0d:a3:47:a8:f7.

Are you sure you want to continue connecting (yes/no)?

Enter “yes” and press Return to finish authenticating.

This manual is related to the following products: