
Debian の「全て」を理解してまとめておく。
セットアップ
一般ユーザの追加
# useradd hoge -m -s /bin/bash -G sudo # passwd hoge # grep sudo /etc/group # less /etc/passwd # less /etc/sudoers
* Debian系は初めから root は使えない
エイリアスの追加
$ vi .bash_aliases alias ls='ls -lh --color=auto' alias less='less -N' alias ..='cd ..' $ . ~/.bash_aliases
SSH接続でリモートログイン
[港] # systemctl status sshd # ss -tan # netstat -at [-antup] # vi /etc/ssh/sshd_config Port 55555 # systemctl sshd restart # ss -tan # lsof -i:55555 # ls /etc/ssh # ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub # vi /etc/ssh/sshd_config PasswordAuthentication no $ ls -l ~/.ssh/authorized_keys
[領内] # ssh-keygen -t ed25519 # vi ~/.ssh/config HOST hoge HostName moge.vs.sakura.ne.jp Port 55555 # ssh-copy-id hoge # ssh-add # ssh-add -l # ssh hoge
* ssh-copy-id など、入っていないコマンドがあったら apt や yum でインストール