Ubuntu new machine configuration

Ubuntu new machine configuration

foreword

After using the ubuntu system before, I found many differences from centos, including the new machine without ifconfig, systemctl command, network card configuration, etc. This article records these different points and related operation plans.

1. No network

There was no network when it was first installed. At this time, there were no ifconfig and vim commands, and the vi command was incomplete. Therefore, at this time, you need to click the icon in the upper right corner to temporarily configure the network.

After manually modifying the IPv4 address to your own network segment, you can succeed:

2. There is no ifconfig command

Reference article:

[https://jingyan.baidu.com/article/91f5db1b8ddace5d7f05e398.html]:

The reason is that the net-tools toolkit will not be installed by default in Ubuntu, which means that ifconfig cannot be used. You can install net-tools from the software repository with the command:sudo apt-get install net-tools

The net-tools toolbox includes commands such as arp, hostname, ifconfig, netstat, rarp, route, plipconfig, slattach, mii-tool and iptunnel and ipmaddr.

If I try it, I can't locate the software package. As mentioned in the reference article, it is because my Ubuntu software source is still Ubuntu's own source. In foreign countries, it is possible that I cannot access the software source website. Therefore, first perform the operation of replacing the software source, replace the software source with Tsinghua source, and execute the sudo apt-get updatecommand.

An error is reported, suggesting that it is extreme to delete the lock file directly, so use kill to kill the process.

After updating the software source successfully, download the net-tools toolkit.

3. Ubuntu cannot connect to Xshell

Problem 1: Ubuntu cannot connect to Xshell

When Ubuntu is just downloaded, there is no sshd service. You need to download the ssh service:

apt-get install -y ssh

Question 2: After the installation is complete, you can only log in as a normal user, and you cannot connect to the root user

At this time, you need to modify the configuration file:

vi /etc/ssh/sshd_config

#PermitRootLogin prohibit-passwordAdd a line after about line 33

PermitRootLogin yes

Then restart the sshd service just fine:

/etc/init.d/ssh restart

4. No VIM editor

The vi editor of ubuntu is very stubborn. After ubuntu22.04 is installed, there is no vim editor, only vi. The built-in vi is not complete, so there is no way to use the up, down, left, and right arrow keys in input mode, so you still need to download the vim editor:

apt-get install -y vim

Five, ubuntu new machine can not enter root

Similarly, the root in the newly installed ubuntu needs to be configured with a password first, and the root password needs to be configured in the normal user mode:

sudo passwd root
输入普通用户的密码:
root新密码:
在输入一遍:

ot needs to configure a password first, you need to configure the root password in the normal user mode:

sudo passwd root
输入普通用户的密码:
root新密码:
在输入一遍:

After success you can su root.
END

Guess you like

Origin blog.csdn.net/tu464932199/article/details/126680260