Copyright | marp | theme | paginate |
---|---|---|---|
(C) 2023 long-910 |
true |
true |
Ubuntu Server 22.04.2 LTSをインストール後の設定を残す。
$ sudo adduser User_Name
$ ls -l /home
$ sudo gpasswd -a User_Name sudo
$ sudo userdel -r ubuntu
$ sudo apt install tmux
$ which tmux
$ curl https://raw.githubusercontent.com/long-910/home/main/.tmux.conf > .tmux.conf
$ sudo apt install zsh
$ which zsh
$ chsh
Changing the login shell for long910
Enter the new value, or press ENTER for the default
Login Shell [/bin/bash]: /usr/bin/zsh
#Logout/Login
$ echo $SHELL
/usr/bin/zsh
$ curl https://raw.githubusercontent.com/long-910/home/main/.zshrc > .zshrc
$ source .zshrc
$ sudo apt install emacs
$ which emacs
$ curl https://raw.githubusercontent.com/long-910/home/main/.emacs.el > .emacs.el
# SCPでサーバーに公開鍵を送付
$ mkdir .ssh
$ cat id_rsa.pub > ~/.ssh/authorized_keys
$ chmod 600 .ssh/authorized_keys
$ sudo emacs /etc/ssh/sshd_config
-#Port 22
+Port 2222
-#PermitRootLogin prohibit-password
+PermitRootLogin no
-#PubkeyAuthentication yes
+PubkeyAuthentication yes
-#PermitEmptyPasswords no
+PermitEmptyPasswords no
$ sudo service ssh restart
$ sudo apt-get install ufw
$ sudo ufw allow 2222/tcp
$ sudo ufw enable