Mac OS X ServerIntroduction to Command-Line AdministrationVersion 10.6 Snow Leopard
10Use this chapter to determine when to use command-line tools and to understand the fundamentals of how to use them.A command-line interface (CLI)
Chapter 1 Introduction to the Command-Line Environment 11The Command-Line EnvironmentThis section gives some background information about UNIX a
Logging In from TerminalTo open Terminal, click the Terminal icon in the dock or double-click the application icon in the Finder (in /Applications/Uti
Chapter 1 Introduction to the Command-Line Environment 13The following processes and services aren’t running if you boot into single-user mode:D
For example, to run the ls command in the current user’s home folder, you could enter the following at the command line and press Return:host:~ mariah
Chapter 1 Introduction to the Command-Line Environment 15Specifying Files and FoldersMost commands operate on les and folders, whose locations
Commands Requiring Root or Administrator PrivilegesMany commands used to manage a server must be executed by an administrator user or the root user. F
Chapter 1 Introduction to the Command-Line Environment 17To view a list of options and parameters you can use with the command:Enter the command
Not all commands and tools have man pages. Some tools use info pages instead, and some have no documentation at all. For more information about info p
19Use this chapter to learn about using the command-line by typing in commands.You can use the command-line environment in Mac OS X and Mac OS X S
Apple Inc. K© 2009 Apple Inc. All rights reserved.Under the copyright laws, this manual may not be copied, in whole or in part, without the written
Redirecting Input and OutputFrom the command line, you can redirect input and output from a command to a le, or to another command.Redirect output fr
Chapter 2 Using the Command-Line Shell Interactively 21Using Environment VariablesThe shell uses environment variables to store information, suc
Repeating CommandsTo repeat a command, press the Up Arrow key until you see the command, then make any modications and press Return.Including Paths U
23Instead of entering commands and waiting for their responses, you can compose scripts that are run without direct interaction.This chapter discu
You need to use the chmod tool to indicate to the operating system that the text le is executable (that is, its contents can be run as a program). To
Chapter 3 Scripting the Command Line 25Note: In earlier versions of Mac OS X and Mac OS X Server, system administrators used the watchdog daemo
The rst crontab entry repairs disk permissions for the MacHD volume at 18:30 every day, Monday through Friday:30 18 * * 1-5 diskutil repairPermission
27Learn about using the command-line on computers remotely.If you need to run command-line tools on remote computers, there are tools to help you.
The remote computer attempts to authenticate the local computer using RSA or ÂDSA certicates. If this isn’t possible, the local computer is prompted
Chapter 4 Connecting to Remote Computers 29To generate the identity key pair: 1 Enter the following command on the local computer:$ ssh-keygen
5 Preface: About This Guide5 What’s in This Guide6 Using Onscreen Help7 Documentation Map7 Viewing PDF Guides Onscreen8 Printing PDF Guides8 G
A Key-Based SSH Scripting ExampleA cluster of servers is an ideal environment for using key-based SSH. The following Perl script is a trivial scriptin
Chapter 4 Connecting to Remote Computers 31Be sure this is the correct key before accepting it. If possible, provide users with the encryption k
Important: Removing a host key from the known_hosts le bypasses a security mechanism that would help you avoid imposters and man-in-the-middle attac
Chapter 4 Connecting to Remote Computers 33Apple Remote DesktopApple Remote Desktop is a software package that’s available separately from Mac
34This chapter discusses some of the most frequently used command-line task.If you’re new to the command-line environment, it helps to understand so
Chapter 5 Common Command-Line Tasks 35For general-purpose work, it’s easiest to deal with one of the text editors included with Mac OS X. If yo
Saving Text Files for UNIX ExecutionWhen you edit text les for execution by UNIX utilities, you need to save the les properly so that they can be us
Chapter 5 Common Command-Line Tasks 37 Â plutil is a command-line tool that you can use to change a property list into a format you can edit wi
There are many other options for PlistBuddy that are invoked in a similar manner. For information about PlistBuddy, see its man page.Using the defaul
Chapter 5 Common Command-Line Tasks 39Moving and Copying FilesYou can move and copy les locally or remotely using the mv, cp, and scp commands.
4 Contents23 Chapter 3: Scripting the Command Line23 What is a Shell Script?24 Monitoring and Restarting Critical Services with launchd25 Sc
Compressing and Uncompressing File ArchivesMac OS X and Mac OS X Server use the GNU tar utility to compress and uncompress les and folders. When send
Chapter 5 Common Command-Line Tasks 41Key Command ActionJ or Down Arrow Scroll down a lineK or Up Arrow Scroll up a lineN Find the next occurren
42Learn how to access hardware-level controls like restarting, shutting down, powering up, and selecting boot options from the command line.This cha
Chapter 6 Accessing Apple Hardware from the Command Line 43Parameter Descriptionseconds The number of seconds before the computer starts after a
Manipulating Open Firmware NVRAM VariablesTo manipulate Open Firmware NVRAM variables, use the nvram tool. If you change a value with nvram, the valu
45The following command line tools are unique to Mac OS X or substantially dierent from implementations on other UNIX platforms. See their man pa
46 Appendix Command-Line Tools Specic to Mac OS XconfigureLocalKDC(1) Generate a LocalKDCCPlusTestRig(1) Runs CPlusTest unit test bundlesCpMa
Appendix Command-Line Tools Specic to Mac OS X 47javaconfig(1) Get Java conguration information javatool(1) Tool used in building older Java s
48 Appendix Command-Line Tools Specic to Mac OS Xopendiff(1) Use FileMerge to graphically compare or merge le or directories osacompile(1) C
Appendix Command-Line Tools Specic to Mac OS X 49securityd(1) Security context daemon for Authorization and cryptographic operations SetFile(1)
5This guide provides a starting point for administering Mac OS X Server using command-line tools.Introduction to Command-Line Administration suppl
50 Appendix Command-Line Tools Specic to Mac OS XSection 4 Man PagesMan pages in section 4 refer to descriptions of special les and devices.
Appendix Command-Line Tools Specic to Mac OS X 51Section 7 Man PagesMan pages in section 7 are miscellaneous pages that don’t belong in any oth
52 Appendix Command-Line Tools Specic to Mac OS Xcoreaudiod(8) Core Audio daemon dirhelper(8) Helper for special directory creationdiskarbitr
Appendix Command-Line Tools Specic to Mac OS X 53kdcsetup(8) Kerberos -- Open Directory Single Sign On kerberosautoconfig(8) Kerberos -- Open D
54 Appendix Command-Line Tools Specic to Mac OS Xmount_webdav(8) Mount a WebDAV lesystemmsdos.util(8) DOS/Windows (FAT) le system utilityna
Appendix Command-Line Tools Specic to Mac OS X 55service(8) Deprecated service_helper(8) Helper program for enabling and disabling servicessetr
Aaccessadministrator 16shell 11, 12, 13SSH service 32user 32accounts, authentication 29administrator, permissions 16Apple Remote Desktop (ARD)
Index 57info tool 18input/output commands 19, 20ipmitool tool 44KKerberos 28key-based authentication 28, 30known_hosts le 31, 32Llaunchctl t
58 IndexUuninterruptible power supply. See UPSUNIX 11, 36UPS (uninterruptible power supply) 43usersaccess control 32authentication 30single-use
6 Preface About This GuideUsing Onscreen HelpYou can get task instructions onscreen in Help Viewer while you’re managing Snow Leopard Server.
Preface About This Guide 7Documentation MapSnow Leopard has a suite of guides that cover management of individual services. Each service may be
8 Preface About This GuidePrinting PDF GuidesIf you want to print a guide, you can take these steps to save paper and ink:Save ink or toner by
Preface About This Guide 9Getting Additional InformationFor more information, consult these resources: Â Read Me documents—get important updates
Commenti su questo manuale