15行目: 15行目:
===SSH接続===
===SSH接続===
  [港]
  [港]
  # systemctl status sshd
  $ systemctl status sshd
  # ss -tan
  $ ss -tan
# netstat -at [-antup]
  # vi /etc/ssh/sshd_config
  # vi /etc/ssh/sshd_config
   Port 55555
   Port 55555
  # systemctl sshd restart
  # systemctl sshd restart
  # ss -tan
  $ ss -tan
  # lsof -i:55555
  $ lsof -i:55555
  # ls /etc/ssh
  # ls /etc/ssh
  # ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
  $ ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
  # vi /etc/ssh/sshd_config
  # vi /etc/ssh/sshd_config
   PasswordAuthentication no
   PasswordAuthentication no
  $ ls -l ~/.ssh/authorized_keys
  $ cat ~/.ssh/authorized_keys


  [領内]
  [領内]
39行目: 38行目:
  # ssh-add -l
  # ssh-add -l
  # ssh hoge
  # ssh hoge
* ssh-copy-id など、入っていないコマンドがあったら apt や yum でインストール

2022年11月28日 (月) 15:55時点における版

debian

Debian の「全て」を理解してまとめておく。

セットアップ

  • Debian はインストール時に root と一般ユーザが登録される
  • sudoコマンドがないので、su で root になって操作する。root が馴染み深くなる

エイリアスの追加

$ vi .bash_aliases
 alias ls='ls -lh --color=auto'
 alias less='less -N'
$ . ~/.bash_aliases

SSH接続

[港]
$ systemctl status sshd
$ ss -tan
# 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
$ cat ~/.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