編集の要約なし
編集の要約なし
2行目: 2行目:


Debian の「全て」を理解してまとめておく。
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 でインストール

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

debian

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 でインストール