Linux編|Ubutu 1804システムの基本構成
2503 ワード
Ubutu 1804システムの基本構成
Ubuntuシステムをインストールしたら、以下の構成最適化システムを使用できます.
1.rootユーザーのパスワードの変更 sudo passwd root
2.rootユーザーがリモートログインと起動できるように構成を変更するrootログイン sudo sed -i 's@mesg n || true@tty -s && mesg n || true@' /root/.profile
sudo sed -i 's@mesg n || true@tty -s && mesg n || true@' /root/.profile
:
/root/.profile
root@ubuntu1804:~# cat /root/.profile
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
tty -s tty -s mesg n || true
root@ubuntu1804:~#
以上の構成が有効になり、システムを再起動する必要があります.
3.Ubuntuのaptソースの変更
1.アリクラウドのUbuntuソースを開く
https://opsx.alibaba.com/mirror
2.Ubuntuの行を見つけて、後ろの「ヘルプ」をクリック
3.上記のヒントに従って、/etc/apt/sources.listファイルを開く
sudo passwd root
2.rootユーザーがリモートログインと起動できるように構成を変更するrootログイン sudo sed -i 's@mesg n || true@tty -s && mesg n || true@' /root/.profile
sudo sed -i 's@mesg n || true@tty -s && mesg n || true@' /root/.profile
:
/root/.profile
root@ubuntu1804:~# cat /root/.profile
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
tty -s tty -s mesg n || true
root@ubuntu1804:~#
以上の構成が有効になり、システムを再起動する必要があります.
3.Ubuntuのaptソースの変更
1.アリクラウドのUbuntuソースを開く
https://opsx.alibaba.com/mirror
2.Ubuntuの行を見つけて、後ろの「ヘルプ」をクリック
3.上記のヒントに従って、/etc/apt/sources.listファイルを開く
sudo sed -i 's@mesg n || true@tty -s && mesg n || true@' /root/.profile
sudo sed -i 's@mesg n || true@tty -s && mesg n || true@' /root/.profile
:
/root/.profile
root@ubuntu1804:~# cat /root/.profile
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
tty -s tty -s mesg n || true
root@ubuntu1804:~#
1.アリクラウドのUbuntuソースを開く
https://opsx.alibaba.com/mirror
2.Ubuntuの行を見つけて、後ろの「ヘルプ」をクリック
3.上記のヒントに従って、/etc/apt/sources.listファイルを開く
vi /etc/apt/sources.list
4.Ubuntuのバージョンを選択し、ubuntu 18.04(bionic)のようなaptソースの構成をコピーします.
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
5.aptソースの更新
apt-get update
6.aptソースを更新すると、apt-getでソフトウェアをインストールできます
: haproxy keepalived
apt-get install haproxy keepalived
“y”,
4.ホスト名の変更 1.
vi /etc/hostname
2.
reboot
5.デフォルトubuntuのNIC名を「eth」形式に変更 1. vi /etc/default/grub
2. GRUB_CMDLINE_LINUX
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
3. grub.cfg
grub-mkconfig -o /boot/grub/grub.cfg
4.
"ensxx" “ethxx”
5.
1.
vi /etc/hostname
2.
reboot
1. vi /etc/default/grub
2. GRUB_CMDLINE_LINUX
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
3. grub.cfg
grub-mkconfig -o /boot/grub/grub.cfg
4.
"ensxx" “ethxx”
5.