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.

Ubuntu22.04LST Server セットアップ備忘録

Last updated at Posted at 2023-06-26

最初からOpenSSHが入ってるので、ローカルでやることはない。

初期アプデ

sudo apt update && sudo apt upgrade

IPアドレスを固定

# インターフェース名を確認
cat /etc/netplan/00-installer-config.yaml
# デフォルトのネットワーク設定ファイルを無効化
cd /etc/netplan/
ls
sudo mv 00-installer-config.yaml 00-installer-config.yaml.disabled
sudo vi 

# 以下サンプル
network:
    version: 2
    renderer: networkd
    ethernets:
        enp4s0:
            addresses:
                - 192.168.xxx.xxx/24
            nameservers:
                addresses: [8.8.8.8, 192.168.xxx.1]
            routes:
                - to: default
                  via: 192.168.xxx.1
# 以上サンプル

sudo netplan apply

SSH公開鍵認証

  • 接続するPCのid_rsa.pubをホームへコピー
  • 新規接続にて公開鍵認証ができることを接続テストするまで、古い接続は切らないこと
ssh-keygen -t rsa
cat id_rsa.pub >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
sudo vi /etc/ssh/sshd_config

# 以下を追記
PubkeyAcceptedAlgorithms=+ssh-rsa
# 以下を追記(コメントアウト済みを編集)
PasswordAuthentication no

systemctl restart ssh.service

Nvidia Driver

# recommendが付いている、open,server以外のものを指定
ubuntu-drivers devices
sudo apt update && sudo apt install nvidia-driver-xxx
sudo reboot now
nvidia-smi

Docker

# ユーザー権限追加
sudo groupadd docker
sudo gpasswd -a $USER docker
sudo service docker restart
sudo reboot now

Git

git config --global user.name “XXXXXX”
git config --global user.email XXXXX@XXXXXX

Python

sudo apt update
sudo apt install python3-venv python3-dev python3-distutils python3-pip

Poetry

# ローカル環境に.venvを生成するよう設定
poetry config virtualenvs.in-project true
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?