Apple Xserve Up Mac OS X Server User's Guide Page 30

  • Download
  • Add to my manuals
  • Print
  • Page
    / 86
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 29
30 Chapter 4
Execute Commands
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, then executes the command and returns you to your
admin computer.
Close a SSH Session
When you are 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. Here is an example of what a session might look like if jsmith logs in
to labserver2 as an administrator and then logs out.
[labserver1:~] jsmith%
ssh -l jsmith labserver2
Welcome to Darwin!
[labserver2:~] jsmith% exit
logout
Connection to labserver2 closed.
[labserver1:~] jsmith%
About Key Fingerprints
The first time you connect to a server using SSH, your local computer adds a “fingerprint”
from the remote server to a list of known remote host computers. The next time you
connect, you won’t see this message. Here’s what jsmith might see if he logged in to a server
for the first time.
ssh -l jsmith 192.168.12.12
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)? yes
Warning: Permanently added '192.168.12.12' (RSA) to the list of known
hosts.
[email protected]’s password:
LL2133.book Page 30 Friday, May 24, 2002 11:17 AM
Page view 29
1 2 ... 25 26 27 28 29 30 31 32 33 34 35 ... 85 86

Comments to this Manuals

No comments