Introdução ao Backend em Linux
Introdução ao Backend em Linux
In Linux, each file and directory is owned by a user, and permissions can be divided into three categories: read (r), write (w), and execute (x). Access can be assigned to user (u), group (g), or others (o). Only administrators like 'sudo' users can alter permissions. Permissions determine what actions users can perform on files and directories .
The '/etc' directory in Linux stores configuration files essential for system operation and service management. System administrators frequently access this directory to modify settings and manage services. The directory is critical for the overall configuration and smooth operation of a Linux system .
SSH, or Secure Shell Protocol, is a network protocol used to securely access and manage servers remotely over TCP connections. It uses port 22 as its standard communication port, providing encrypted pathways for remote user access .
The 'vi' text editor is a versatile tool used in Linux for text editing, whereas 'vim' is an improved version of 'vi' with additional functionalities. While both serve the same basic purpose of editing text, 'vim' includes enhancements that make it more powerful for advanced text editing tasks .
The 'find' command is utilized to search for directories in Linux. To find directories specifically, the '-type d' option is used. For case-insensitive searches, the '-iname' option can be employed, which allows searching without case sensitivity, thus simplifying the search for directory names that may include mixed cases .
Linux offers several benefits, including security, as it is less vulnerable to viruses and malware; stability, due to its robust design; versatility, as it can run on various devices; cost-effectiveness, as it is free to use; and ample support from a large community .
Groups in Linux organize users for streamlined management, granting access permissions collectively rather than individually. A user can belong to multiple groups, facilitating organized permission and role management. To add a user to a group, the 'usermod -a -G' command is used, requiring the user to log out and back in for changes to take effect .
Linux distributions can be categorized based on their personal or commercial use. Personal use distributions, like Ubuntu Desktop, provide user-friendly interfaces similar to Windows. Distributions intended for commercial use, particularly on servers, often focus on stability and resource allocation, and users typically interact with these systems via the command line .
The 'chmod' command changes file or directory permissions by modifying access rights. Users can set permissions for user, group, others, or all using symbols (u, g, o, a) combined with operations (+, -, =) and levels of permission (r, w, x). It is crucial to consider the security implications and ensure the correct level of access is set, especially for sensitive files .
The 'systemctl' command simplifies service management in Linux by providing a centralized interface to start, stop, and configure services without directly accessing the service directories under '/etc'. It streamlines service control and management, enhancing efficiency for administrators .