Opening an ssh session, Executing commands in an ssh session, Closing an ssh session – Apple Mac OS X Server (version 10.2.3 or later) User Manual
Page 592

592
Chapter 17
Opening an SSH Session
Open an SSH session and log in to a remote server when you manage the remote server
using command-line tools.
To open an SSH session and log in to the server:
1
Open Terminal.
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.
LL0395.Book Page 592 Wednesday, November 20, 2002 11:44 AM