LoginSignup
0
0

More than 3 years have passed since last update.

ArchLinux LDAP Authセットアップ

Posted at

Arch Linuxのインストールガイドに従って作業を行う。

環境

  • Windows 10
  • VirtualBox 6.0.12 r133076
  • archlinux-2019.09.01-x86_64.iso

CDブート

"Boot Arc Linux (x86_64)" を選択

キーボードの設定

# loadkeys jp106

パーティション作成

Command (? for help):n
Permission number: 1
First sector : (default)
Last sector  : +1M
Hex code or GUID : ef02 // select BIOS boot partition

Command (? for help):n
Permission number: 2
First sector : (default)
Last sector  : (default)
Hex code or GUID : 8300

Command (? for help):p
... EF02   BIOS boot partition
    8300   Linux filesystem

Command (? for help):w
Do you want to proceed? (Y/N): y

フォーマット&マウント

# mkfs.xfs /dev/sda2
# mount /dev/sda2 /mnt

パッケージのインストール

# vim /etc/pacman.d/mirrorlist
以下の2つを最上位に持ってくる
## Japan
Server = http://ftp.jaist.ac.jp/pub/Linux/ArchLinux/$repo/os/$arch
## Japan
Server = http://ftp.tsukuba.wide.ad.jp/Linux/archlinux/$repo/os/$arch

# pacstrap /mnt base base-devel
(/mntの下にパッケージがインストールされる)

パッケージインストール後の設定

# genfstab -U -p /mnt >> /mnt/etc/fstab
# arch-chroot /mnt
# pacman -S --needed vim
# alias vi='vim'
# vim /etc/locale.gen

   en_US.UTF-8 UTF-8
   ja_JP.UTF-8 UTF-8
   のコメントを外す

# locale-gen
# echo LANG=en_US.UTF-8 > /etc/locale.conf
# export LANG=en_US.UTF-8
# echo KEYMAP=jp106 > /etc/vconsole.conf

# ln -f -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
# hwclock --systohc --utc
# echo localhost > /etc/hostname

# passwd
(rootのパスワードを入力)

# pacman -S grub dosfstools
# grub-install --target=i386-pc /dev/sda
# grub-mkconfig -o /boot/grub/grub.cfg

# systemctl enable dhcpcd

# exit
# umount -R /mnt
# reboot

CD Bootの画面で "Boot existing OS" を選択する。

ホームのマウント

他のディストリビューションで利用しているホームパーティションを
マウントする。

# vi /etc/fstab
/dev/sdb    /home   xfs  defaults   0 0
# mount /dev/sdb /home

仮ユーザー追加

Arch Linuxのmakepkgコマンドはrootでは実行できない。
そのため、LDAP認証の設定が完了するまでは仮のユーザーで作業する。

# useradd -u 5000 -g users -G wheel -m dummy
# passwd dummy
# visudo
%wheel ALL=(ALL) ALL  <--- コメント解除
$ sudo pacman -S --needed tmux
$ sudo pacman -S --needed openssh
$ sudo systemctl start sshd
$ sudo systemctl enable sshd
$ sudo systemctl stop dhcpcd
$ sudo systemctl disable dhcpcd
$ sudo shutdown -r now
$ sudo vi /etc/systemd/network/20-wired.network
[Match]
Name=enp0s3

[Network]
Address=192.168.11.79/24
Gateway=192.168.11.1
DNS=192.168.11.1

$ sudo systectl start  systemd-networkd
$ sudo systectl enable systemd-networkd

IPアドレスを確認する。

$ ip addr

以降、puttyなどで接続する。

(中断)

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