Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
System administration is a crucial aspect of managing any operating system, including Apple's macOS. While macOS is known for its user-friendly interface, it also provides robust tools for system administrators to manage and configure the system effectively. This article will guide you through some essential system administration tasks on macOS, using Terminal commands and other built-in tools.
Examples:
Managing Users and Groups:
Create a New User:
To create a new user account, you can use the sysadminctl
command in Terminal. This command requires administrative privileges.
sudo sysadminctl -addUser newusername -fullName "New User" -password "userpassword"
Delete a User: To delete a user account, use the following command:
sudo sysadminctl -deleteUser oldusername
List All Users:
You can list all users on the system using the dscl
command:
dscl . list /Users
Managing System Preferences:
Change Hostname:
To change the system's hostname, use the scutil
command:
sudo scutil --set HostName newhostname
Configure Network Settings:
You can view and configure network settings using the networksetup
command. For example, to set a new DNS server:
sudo networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4
File System Management:
Check Disk Usage:
To check the disk usage of your system, you can use the df
command:
df -h
Repair Disk Permissions:
Although newer versions of macOS handle permissions automatically, you can manually repair disk permissions using diskutil
:
sudo diskutil repairPermissions /
Software and Updates Management:
Install Software Updates:
To install software updates, use the softwareupdate
command:
sudo softwareupdate -i -a
List Available Updates: To see which updates are available, use:
softwareupdate -l
Security and Privacy:
Enable Firewall:
To enable the firewall for enhanced security, use the defaults
command:
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
Configure FileVault: To enable FileVault for disk encryption, use:
sudo fdesetup enable
These examples illustrate how macOS provides a comprehensive set of tools for system administration, allowing you to manage users, configure system settings, manage the file system, handle software updates, and ensure security.