0
0

More than 3 years have passed since last update.

ECS LIVA ZにDebian 10 busterをインストール

Last updated at Posted at 2020-09-26

はじめに

ECS LIVA ZにDebian 9 stretchをインストール - Qiita」の続き

WindowsでDebian USBメモリ作成

  1. Debian を入手する/CD/USB ISO イメージ/HTTP を使って CD/DVD イメージをダウンロードする/公式の安定版 (stable)リリース用 CD/DVD イメージ/CD/amd64」から「debian-10.5.0-amd64-xfce-CD-1.iso」をダウンロード
  2. RufusでUSBメモリに書き込み

インストール

  1. USBメモリをLIVA Zに接続
  2. LANケーブルをACアダプタに近い方のポート「enp1s0」に接続、遠い方は「enp3s0」
  3. LIVA Zを起動
  4. 手順通りにインストール
  5. WebサーバとSSHサーバを追加
  6. インストール中のスクリーンショットは「/var/log/installer/*.png」に保存される

visudo

  1. sudoを使えるように設定

    $ su -
    # visudo
    # User privilege specification
    root     ALL=(ALL:ALL) ALL
    igarashi ALL=(ALL:ALL) ALL
    

FileZilla

  1. 「アプリケーションメニュー/設定/Synaptic パッケージマネージャ」を起動
  2. 「filezilla」をインストール
  3. 「アプリケーションメニュー/インターネット/FileZilla」から起動できる
  4. 「サイト マネージャー/文字コード/自動検出」→「UTF-8 を強制」にすると日本語が文字化けしなくなった

NullMaier

  1. hosts設定

    $ sudo nano /etc/hosts
    127.0.0.1       localhost
    127.0.1.1       debian.mkt.home debian
    192.168.0.1     debian.mkt.home debian
    ...
    
  2. 「アプリケーションメニュー/設定/Synaptic パッケージマネージャ」を起動

  3. 「nullmailer」「mailutils」をインストール

    • システムのメール名
      • debian.mkt.home
    • スマートホスト
      • smtp.gmail.com smtp --auth-login --port=587 --starttls --user=your-name@gmail.com --pass=your-password
  4. 追加設定&動作確認

    $ sudo sh -c "echo $(hostname --fqdn) > /etc/nullmailer/defaultdomain"
    $ sudo sh -c "echo 'target-email-address@your-domain.net' > /etc/nullmailer/adminaddr"
    $ echo "error" | NULLMAILER_NAME="Testsytem check" mail -s "This is just a test with nullmailer" "target-email-address@your-domain.net"
    

cron-apt

  1. 「アプリケーションメニュー/設定/Synaptic パッケージマネージャ」を起動
  2. 「cron-apt」をインストール
  3. README

    $  gzip -dc /usr/share/doc/cron-apt/README.gz | less
    
  4. config

    $ sudo nano /etc/cron-apt/config
    MAILON="always"(動作確認したら"upgrade"に変更する)
    SYSLOGON="always"(動作確認したら"upgrade"に変更する)
    MAILTO="root"
    
  5. 3-download

    $ sudo nano /etc/cron-apt/action.d/3-download
    autoclean -y
    #dist-upgrade -d -y -o APT::Get::Show-Upgraded=true
    dist-upgrade -y -o APT::Get::Show-Upgraded=true
    
  6. 動作確認

    $ sudo /usr/sbin/cron-apt 
    

cron-aptを設定しない場合に普段やること

  1. 「アプリケーションメニュー/設定/Synaptic パッケージマネージャ」を起動
  2. 「状態」ボタンを押す
  3. 「再読込」ボタンを押す
  4. 「インストール済み(アップグレード可能)」を選択
  5. 表示されたパッケージをCtrl + aで全選択
  6. 右クリックメニューで「アップグレード指定」を選択
  7. 「依存により要求された変更を追加しますか?」画面が表示されたら「マーク」ボタンを押す
  8. 「適用」ボタンを押す
  9. 「Apply」ボタンを押す
  10. 「インストール済み(自動削除可能)」を選択
  11. 表示されたパッケージをCtrl + aで全選択
  12. 右クリックメニューで「完全削除指定」を選択
  13. 「適用」ボタンを押す
  14. 「Apply」ボタンを押す

SSHで鍵認証

  1. WindowsのPowerShellで鍵作成

    ssh-keygen
    Enter file in which to save the key (/Users/igarashi/.ssh/id_rsa): ←[ENTER]を入力
    Enter passphrase (empty for no passphrase): ← パスフレーズを入力
    Enter same passphrase again: ← パスフレーズを再入力
    
  2. 公開鍵「.ssh/id_rsa.pub」をDebianにFTPなどで転送

  3. 公開鍵を配置

    $ cat id_rsa.pub >> ~/.ssh/authorized_keys
    $ chmod 0600 ~/.ssh/authorized_keys
    
  4. パスワード認証を無効に

    $ sudo nano /etc/ssh/sshd_config
    # To disable tunneled clear text passwords, change to no here!
    #PasswordAuthentication yes
    PasswordAuthentication no
    
  5. サービス再起動

    $ sudo systemctl restart sshd.service 
    
  6. WindowsのPowerShellでSSH接続

    PS C:\Users\igarashi\.ssh> ssh igarashi@debian
    Enter passphrase for key 'C:\Users\igarashi/.ssh/id_rsa': ← パスフレーズを入力
    
  7. WindowsのPowerShellでSSHトンネル作成

    PS C:\Users\igarashi> ssh -L 5901:127.0.0.1:5901 -C -N igarashi@debian
    Enter passphrase for key 'C:\Users\igarashi/.ssh/id_rsa': ← パスフレーズを入力
    
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