Apple oxs Server User Manual


 
16 Chapter 1 Typing Commands
Sending Commands to a Remote Server
Secure Shell (SSH) lets you send secure, encrypted commands to a server over the
network. You can use the ssh command in Terminal to open a command-line
connection to a remote server. While the connection is open, commands you type are
performed on the remote server.
Note: You can use any application that supports SSH to connect to Mac OS X Server.
To open a connection to a remote server:
1 Open Terminal.
2 Type the following command to log in to the remote server:
ssh -l username server
where username is the name of an administrator user on the remote server and
server is the name or IP address of the server.
Example: ssh -l admin 10.0.1.2
3 If this is the first time you’ve connected to the server, you’re prompted to continue
connecting after the remote computer’s RSA fingerprint is displayed. Type yes and
press Return.
4 When prompted, type the user’s password (the user’s password on the remote server)
and press Return.
The command prompt changes to show that you’re now connected to the remote
server. In the case of the above example, the prompt might look like
[10.0.1.2:~] admin$
5 To send a command to the remote server, type the command and press Return.
To close a remote connection
m
Type logout and press Return.
Sending a Single Command
You can authenticate and send a command using a single typed line by appending the
command you want to execute to the basic ssh command.
For example, to delete a file you could type
$ ssh -l admin server1.company.com rm /Users/admin/Documents/report
or
$ ssh -l admin@server1.company.com "rm /Users/admin/Documents/report"
You’re prompted for the user’s password.
LL2354.book Page 16 Monday, October 20, 2003 9:47 AM