I. Overview
LinuxIt is an open-source operating system developed collaboratively by developers worldwide, based on the Unix system. While Linux can operate like a computer using hardware, it can also be experienced through virtual machines in environments where Windows OS is already installed. Virtual machineVirtual Machine)It is essentially a virtual computer, allowing users to install and use various operating systems, including Windows, in addition to Linux, within this virtual environment. Using VMware, users can create a virtual environment and install Linux. UbuntuThe guide will cover installation and basic usage of the software.
Ⅱ. What is Linux?
LinuxIn brief, UnixIt is an open-source operating system developed by developers worldwide, based on Unix. Unix can be considered the prototype of all modern operating systems. There are several different versions of Linux, which can be broadly categorized as: Debian, a Linux distribution in the Red Hat familyThere are several options, including iOS, a well-known operating system developed within the Debian family. Additionally, the widespread use of Ubuntu has made the Debian family popular, while Red Hat offers open-source software with paid post-sale support. If you're interested in the Red Hat family, I recommend looking into CentOS.
Hardware - Kernel - Shell: In a system composed of applications, the Linux operating system operates through its kernel.

Windows also has a kernel, which functions similarly to the engine in a car. The system's backend functions include: booting, file listing, attribute management (size, type, location), scheduling for multitasking, and memory space management.It manages the interaction between software and hardware. You might have encountered it when using Windows. Blue ScreenThis is a critical system error, indicating that the kernel has become unresponsive and is no longer able to process or control the system.
※ A blue screen indicates a hardware error, which is caused by a drive error. Hardware drives are provided by hardware manufacturers and are designed to be compatible with Windows or Linux versions.
ShellThe kernel, acting as an interpreter, receives and interprets commands, then sends signals to the hardware to control it. The hardware, in turn, sends electrical signals back to the kernel, allowing it to execute applications through the shell. Shell is a command-line interface (CLI) on Windows.It includes commands like `ping`, `ipconfig`, and `notepad`, which are used to run or manage applications. The shell also has scripts with built-in automation features, allowing users to automate a series of commands and perform repetitive tasks.
Before accessing the virtual machine, you need to download the Linux ISO file. It may take some time, so I recommend doing it in advance.
Ubuntu 20.04.6 LTS (Focal Fossa)
Ⅲ. Virtual Machines and Networking
Virtual machine
Virtual Machine (VM)It is a type of virtual computer that functions as a router. Virtual RouterThis allows the use of multiple operating systems on a single computer across various virtual environments. Inside the virtual machine program, there is Guest OSThere may be multiple instances of this. Host operating system (the operating system on my computer)Access is gained through a virtual router. When you install VMware and go into the Windows network settings, you will see the VMware Network Adapter (VMNET). LAN chip (the hardware responsible for connecting the network and the computer)The actual hardware used is not the host computer's hardware (it utilizes the host computer's hardware), but rather a virtual network driver. This driver acts as an interface that allows the host OS to access the guest OS, effectively controlling the hardware through software.

※ Router (a hardware and software system that facilitates communication between different networks)Essentially, it functions as a gateway, and a good analogy is an airport. It connects two networks that communicate according to a protocol, similar to how a Korean citizen must pass through an airport to enter another country. Each network has its own communication characteristics, and defining these characteristics as rules is key. ProtocolThey communicate with each other by following protocol rules, sending and receiving messages. A notable example of a protocol is HTTP (Hyper Text Transfer Protocol)There is a protocol, typically 'http://',https://'로 They are the things that make it easier for us to access information. For example, when using Naver, they help us easily view the information displayed on the Naver screen.
Network
The operating system can use the LAN chip as a network component because of the network driver. As mentioned earlier, the network driver is a program that controls the hardware, the LAN chip. Adapter InterfaceIt communicates and receives electrical signals with other devices to function. The reason I can access Naver, Google, and Daum through the web via my computer is due to the internet protocol: IP address That's because IP addresses are primarily used for IPv4 (Internet Protocol version 4), IPv6 (Internet Protocol version 6)This value indicates how a network device on a personal computer is identified on the network. Typically, when using a router, the IP address will be in the format of 192.168.~ This IP address is an address assigned randomly by the router and can be used by devices connected to the same router. Internal (private) IP addressIt allows you to access external websites, such as Naver, Google, and Daum, to facilitate access. Official (or certified) IP addressI need that.
※ DNS (Domain Name System) serverHowever, computers can only read numbers represented as 0 and 1, so they cannot understand names that are human-readable. Convert IP address valuesThis role involves providing support. For example, "www.naver.com"We can easily access Naver's address because the DNS server converts the address into an IP address, such as 192.168.1.1 (example), so that computers can understand it."
The router automatically assigns and manages IP addresses to devices connected to the network (such as my computer). DHCP (Dynamic Host Configuration Protocol) serverIt performs the function of... The DHCP server... Various network information (IP address, subnet mask, default gateway, etc.)It offers the convenience of flexible configuration, allowing users to automatically set the IP address range without manual configuration. Therefore, the virtual router within the virtual machine program utilizes the host computer's hardware to assign an IP address range to the guest OS through a DHCP server, similar to how devices using the same network share an internal IP address. Sharing is only allowed between guest operating systems.What I can do Internal IP addressIt is.
As explained above, both the host OS and the guest OS appear to have similar IP addresses, making them seem like they are sharing the same network environment, but in reality Different network environmentsIn other words, the Windows LAN adapter and the VMware Network adapter that appear in the network settings are different network environments. So, how can I access the virtual environment from my computer?
The reason is that the host OS accesses Naver through an external IP address, just like Virtual router (gateway) and DNS serverIf you submit a request, This is because the virtual router locates and connects to each guest OS using the IP address assigned to it by the DHCP server. So, how can the host operating system communicate with the external IP address of a virtual environment?
The router (both virtual and physical) NAT (Network Address Translation)This is because it allows devices to be identified by their external IP addresses, making it possible for them to communicate with each other. In other words,
My computer communicates with the LAN adapter and router through the VMware network adapter and virtual router. To better understand this, it's important to understand NAT (Network Address Translation), which I plan to learn more about in future lessons and personal study.
VMware Workstation Pro 17
There are several ways to utilize Linux. One method is to create a new partition and install Windows OS using an ISO image file. The other method, which I will introduce later, involves using a virtual machine. To use a virtual machine, you need to install the necessary software. VMware Workstation Pro 17There are different versions. The "Pro" version is paid, but it offers a 30-day free trial. However, the "Player" version does not allow you to use the important snapshot feature, so I don't recommend it.
Download VMware Workstation Pro
SnapshotIt refers to technologies used in virtual environments, such as software or programs used to create or install content within those environments. ImageWe create snapshots regularly. This allows us to quickly revert to a previous state if errors occur during work, making recovery much easier. Without snapshots, we would have to start from scratch, which could be a major setback. Furthermore, in the event of a ransomware attack that corrupts or renders a database unusable, the absence of snapshots could lead to a situation where everything has to be rebuilt, or even completely lost. Incremental backup feature for snapshotsThrough log analysis, it is possible to easily identify and recover from specific situations when they occur. Incremental backups Record only the data that changes after the initial image is taken, as a new snapshot.This is a function that allows you to create a snapshot. A snapshot is... Tree structureIt is designed to be
※ Ransomware: This type of algorithm, used for encryption in authentication keys from banks and other institutions, is a one-way algorithm that cannot be decrypted. Therefore, it is impossible to recover data encrypted using this algorithm.
I have attached a well-written blog post about installing VMware Workstation Pro.
How to download and install VMware Workstation Pro version 17
I would like to express my gratitude to the owner of this blog.
Once VMware is installed and running, you will see this screen.

Before installing Linux, you need to create a virtual machine. Click on "Create a New Virtual Machine" as shown in the image.

When you click this, you'll see a screen where you can select "Custom." This allows you to configure hardware, operating system, and network types individually.

This section asks if you want to install the Ubuntu ISO file. Since you can configure and install it individually after booting, I recommend selecting the option at the very bottom.

The next screen will ask you to choose an operating system. Since you're using Linux, you should select Linux and then choose either Ubuntu or Ubuntu 64-bit, depending on the bit version of your computer.

The next screen allows you to set the name of the virtual machine and the directory, and you can do so freely.

This also asks about how much of the process to use, and the default setting is fine.

This section requires configuration, and since it uses standard personal computer hardware, creating multiple virtual environments can lead to performance issues due to memory limitations. Additionally, when using Linux through a console, you don't need to use X-Windows (GUI), so it's possible to run with less memory. Therefore, I recommend 1GB, but if the boot process is slow after configuration, you can also increase the memory slightly.
※ 3-tier architectureThe server will be structured with three distinct layers: the client layer, the application layer, and the data layer. This setup will create at least three virtual environments, which can consume a significant amount of memory on individual computers, potentially leading to performance issues. I plan to study this architecture in more detail later.

Simply continue pressing the next button until this section appears. Since it utilizes the actual computer's disk space, 20 gigabytes is sufficient for general learning purposes, but if needed, the capacity can be increased further.

Once you reach this point, you can assume that all the settings are complete. Simply press "Next" and then "Finish" at the end.
※ If you go to the specified directory, you will find a file named 'ubntu 64-bit.vmx'. This file allows you to modify or reset the settings or version. If the virtual machine has crashed, a 'Lock file' (ubntu 64-bit.vmx.lck) may remain. If this prevents booting, please navigate to the directory, delete the file, and then try booting again.

On this created screen, you will see the virtual machine you created in the "My Computer" section on the left. Since you have set it up to install the Ubuntu ISO file later, you can simply right-click and go to "Settings" at the bottom to attach the Ubuntu ISO file you previously downloaded.

Once you have created this virtual machine and installed Linux, you will be able to use Linux. The installation process is straightforward and can be done in Korean, so I will not include instructions in that language.
As mentioned briefly above, using X-Windows consumes a significant amount of memory, which is unnecessary if we were to use the console instead. However, we intend to use the terminal to run Linux. Therefore, we need to configure Linux to boot in console mode. First, we will run Linux using X-Windows and then enter the following commands:
sudo systemctl set-default multi-user.target (This command sets the default boot mode to console mode.)
※ Here, "sudo" refers to a request to perform an action with administrator privileges, and "systemctl" is a system configuration command. "set-default" is used to set the boot mode, and the "multi-user" option is related to the boot mode. You can think of "multi-user.target" as being equivalent to a console mode.
sudo apt-get update (This command updates the list of available packages in your Linux system.)
Console and terminal are distinct concepts. A console refers to a physical hardware device, while a terminal is an environment for processing text input and output. Compared to a console, a terminal offers greater convenience for using Linux commands, allowing you to access and use Linux through an SSH server, which facilitates remote access. This is due to the ease of viewing fonts and Korean characters on a terminal server, and because it inherently supports UTF-8.
Install the SSH server using the command: `sudo apt-get install openssh-server -y`
To use an SSH server, a client is required, just like installing a web browser to access a web service. A commonly used client is PuTTY, which can be downloaded from the link below. It's relatively easy to use, so I recommend searching for related articles.
Download PuTTY: latest version (0.79)
※ PuTTYSince you need to know the IP address of the guest OS when accessing remotely, IP address Let's utilize these ports. Web browsers typically use port 80 by default, while PuTTY uses port 22. What is a port? Think of it like an airport gate – it's a connection point for external communication. Therefore, the specific program you use depends on the port number.
※ Regarding Windows ping There is a command that allows you to use a protocol to determine if the network is currently active. This is used in the form of "ping + address," and if there is no response, it indicates that the network is either inactive or blocked for security reasons. Sending a "ping" message causes the server to respond, which is done to prevent the server from being taken down due to a DDoS (Distributed Denial of Service) attack, where large amounts of internet traffic are sent to the server to disrupt its service.
Ⅳ. Linux Commands
There are a vast number of Linux commands, and many well-organized tables created by others. While it would be helpful to memorize these tables, I believe that learning by actually using them is the most effective approach. Therefore, I would like to share a collection of basic commands that I used during my classes. If you need them, you can easily find related commands by searching.
sudo init (0~6)
This is referred to as the "Run Level," and it's the command used during the boot process. A value of 0 indicates system shutdown.
$ sudo shutdown -r(옵션)This command performs the same function. In this command, the '-r' option allows you to specify when the process should terminate. If no time is specified, the process will terminate after a default of 60 seconds. Another frequently used number is '6', which represents 'reboot', and it will restart the system.
2. In
On Windows, you can create shortcuts for specific executable files in Linux, just like you would on the desktop.
ln target(원본) name(바로가기)3. history
history (옵션 -c, -w)
history > /tmp/abc.logThe command list used previously is displayed, and the option '-c' removes the list. The option '-w' saves the current list as a file. The second example means saving the command list to the file named "abc.log" in the directory "/tmp".
4. cat
cat /경로/파일명This command is used to display the contents of a file. It allows you to specify a path and filename to retrieve the contents of a specific file.
※ The directory where configuration information is saved in Linux is: etc.It is.
* The terminal accessed through PuTTY will use the default file explorer. sh While you can modify the shell (explorer) using commands, the way it displays information may vary depending on the shell's settings. For example, when you start a shell through PuTTY, it initially shows the current directory path, but if you change it to "sh," it no longer displays this information.
5. CD
cd /경로
cd -
cd ~idThis command is frequently used to navigate between directories, and if no path is specified, it returns to the `/home/username` directory. When you log in, you are also placed in the same directory. The second example immediately returns to the previous directory. The third example returns to the user's home directory using an ID. If the ID is omitted, it returns to the home directory of the logged-in account.
6. list
ls
ls -al
ls -altrThis command displays the files or directories within a specified directory. The '-al' option displays everything, including hidden files and attributes, in a list format. The '-altr' option displays the same list, but with the files and directories sorted by date (oldest first) and then by name (alphabetical order).
※ When using the command "ls -al" to view the entire list, if the very first character is 'd', it indicates a directory; if it's '-', it indicates a file.
7. touch
touch 파일명Create a new file with a size of 0, and if a file with the same name already exists, update its modification time. For security reasons, this command is sometimes used to create a file in advance, preventing access and thus preventing the creation of a new file.
* Available as an option 'r'If this is included, it could have a different meaning depending on the context. "a"This refers to the entire concept/system/thing. 'f'This refers to either a file or a forced action. 'n'They are mostly related to numbers.
※ Unlike Windows, Linux does not have an extension concept. Therefore, Reverse tunneling The attack technique involves uploading a program to the target server, deceiving the administrator by disguising it as a legitimate file, and then executing it to create a backdoor that allows external access. Because firewalls primarily restrict outgoing connections, attackers can easily access the server from outside and send data through it. Furthermore, Linux lacks the concept of file extensions, making it easier to disguise malicious programs.
8. file
file /경로/파일명Regarding the Linux tips mentioned earlier, there is no concept of file extensions, but this command allows you to determine the type of file.
※ Linux distinguishes between uppercase and lowercase letters and cannot create a folder or file with the same name.
9. head, tail
head /경로/파일명
tail /경로/파일명
head, tail -n 15 /경로/파일명When using the "cat" command to read a file, it reads the entire file, which can take a long time for large files. Therefore, commands like "head" and "tail" are used to display only a portion of the file. "head" reads from the beginning, while "tail" reads from the end. By using the "-n" option, you can specify the number of lines to display, with a default setting of 10.
※ When running an executable in Linux, there are foreground and background modes. Foreground mode keeps the program visible and running in the foreground, making it easy to monitor in real-time. Background mode runs the program in the background, but it is not visible. '-f'Wow '-daemon(-d)'This can be specified as an option.
10. copy
cp 어떤 파일/디렉토리로부터 어디에The `cp` command is used to copy files and directories.
11. room
rm -rf ./경로The `rm` command is used to delete files and directories, and the `-rf` option forces deletion. You can specify a file to delete, or delete an entire directory and all its subdirectories.
12. ifconfig
sudo apt-get install net-tools
ifconfig
ifconfig 인터페이스명 up/downWhile some Linux distributions allow you to use basic commands instead of installing packages for network-related tasks, Ubuntu requires package installation. The `ifconfig` command displays information about network interfaces. It shows the number of received and transmitted packets, and the MAC address (unique identifier) of the network interface. The "up/down" option allows you to enable or disable the interface.
Review
After finishing Python,😄 the class moved on to Linux and networking, where we immediately put our knowledge into practice by installing Linux and Ubuntu using virtual machines. Since this was a new topic for me, I paid extra attention and learned a surprising amount. While I didn't manage to absorb everything, I came to class prepared to review the concepts I had previously learned. Since the concepts are still somewhat unclear, I've written a blog post, and I would appreciate it if anyone could point out any errors in the comments.👋
Log in