0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Linux】構築時の初期設定メモ

Last updated at Posted at 2023-04-16

Linuxサーバ(CentOS, Almalinux)構築後に行う設定作業をメモしておく。

yum update -y

# Sudo can be used no password. (Just Intranet.)
visudo

# Create User
useradd <username>
passwd <username>

# Give sudo Authority to created user
usermod -aG wheel almalinux

# Install software packages
tar # For VS Code.
tmux
git
wget
vim
python (miniconda, pyenvy or From AppStream)

# SELinux is disabled. (Just Intranet.)
vim selinux # Disabled

# Auto log.
mkdir ~/logs
vim ~/.bash_profile に script ~/logs/$(date +%Y%m%d_%H%M%S).log を追記

# Enable access with key authentication.
mkdir .ssh
chmod 700 ~/.ssh
vim ~/.ssh/authorized_keys # Register private key of LOCAL
chmod 600 ~/.ssh/authorized_keys

# Disable firewall. (Just Intranet.)
sudo systemctl stop firewalld
sudo systemctl disable firewalld

# Setting static IP.
sudo yum install net-tools
route # Check default gateway
cat /etc/resolve.conf # Check DNS IPadress
sudo nmcli connection modify <NIC> ipv4.addresses "192.168.x.x/24"
sudo nmcli connection modify <NIC> ipv4.gateway 192.168.x.0
sudo nmcli connection modify <NIC> ipv4.dns 192.168.x.0
sudo nmcli connection modify <NIC> ipv4.method manual
sudo nmcli connection down <NIC>
sudo nmcli connection up <NIC>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?