Last active
September 25, 2015 15:51
-
-
Save choro3/a67a6c93518a7884c773 to your computer and use it in GitHub Desktop.
sudo と ssh だけできるVMを作成するための Kickstart 設定
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Kickstart file automatically generated by anaconda. | |
#version=DEVEL | |
install | |
autostep | |
reboot | |
url --url=http://ftp.jaist.ac.jp/pub/Linux/CentOS/6.7/os/x86_64 | |
lang ja_JP.UTF-8 | |
keyboard us | |
network --onboot yes --device eth0 --bootproto dhcp --ipv6 auto | |
rootpw --iscrypted $6$ym3Uw15BZQABwpNV$y.DHWBBqydDRWbJPPCp1B7FooGaoA9sdIZLLN/Gb4SHG7MWjDOiv9fDHzH3QFr2M6sUyW/dy4f8Sv6mP.zJKR. | |
firewall --service=ssh | |
authconfig --enableshadow --passalgo=sha512 | |
selinux --enforcing | |
timezone --utc Asia/Tokyo | |
bootloader --location=mbr --driveorder=vda --append="crashkernel=auto console=ttyS0,115200n8" | |
# The following is the partition information you requested | |
# Note that any partitions you deleted are not expressed | |
# here so unless you clear all partitions first, this is | |
# not guaranteed to work | |
# | |
# clearpart --linux --drives=vda | |
# volgroup VolGroup --pesize=4096 pv.253002 | |
# logvol /home --fstype=ext4 --name=lv_home --vgname=VolGroup --grow --size=100 | |
# logvol / --fstype=ext4 --name=lv_root --vgname=VolGroup --grow --size=1024 --maxsize=51200 | |
# logvol swap --name=lv_swap --vgname=VolGroup --grow --size=4032 --maxsize=4032 | |
# | |
# part /boot --fstype=ext4 --size=500 | |
# part pv.253002 --grow --size=1 | |
zerombr | |
clearpart --all --initlabel | |
repo --name="CentOS" --baseurl=http://ftp.jaist.ac.jp/pub/Linux/CentOS/6.7/os/x86_64 --cost=100 | |
%packages --nobase | |
@core | |
openssh | |
openssh-clients | |
%end | |
%post --log=/root/ks-post.log | |
sed -i 's/^#\s%wheel\s*ALL=(ALL)\s*ALL\s*NOPASSWORD$/%wheel\tALL=(ALL)\tALL\tNOPASSWORD/g' /etc/sudoers | |
sed -i 's/^#RSAAuthentication\syes/RSAAuthentication yes/g' /etc/ssh/sshd_config | |
sed -i 's/^#PubkeyAuthentication\syes/PubkeyAuthentication yes/g' /etc/ssh/sshd_config | |
sed -i 's/^PasswordAuthentication\syes/PasswordAuthentication no/g' /etc/ssh/sshd_config | |
/etc/init.d/sshd restart | |
useradd -G wheel choro3 | |
mkdir -p /home/choro3/.ssh | |
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzeT9y3hRUvZn3CjJatpZqfTPaZK6btPtJVx2q6AqYooIXn89C7UZdHfj5REqGI9r7G41rqMIXFcJ10S9N64oV4s5e2mv4RMh1W5awq3JAAS1pAVLvv0afAFJkCpOTm6PRgSWqJMgf8+UsteVCBD5ZwoaIE7ec6+hYYoHEX7T452rR4ydsFA9xQvsCIfyZODahqO/kD6Lx5xL4uh2MkhQmqIBP9vWSIRYqIbEOmlv8EaRVx3lsHst5CIvNKP9RsLXTDNfRkJP+f7CUDGe1rnBMqOOWKJp3TKAqWL+NY4z7TZl017g30v8L+338w+w4XdmjhAbiImC1fMpFkheeDIgx choro3@choro3.local" > /home/choro3/.ssh/authorized_keys | |
chown -R choro3:choro3 /home/choro3/.ssh | |
chmod 600 /home/choro3/.ssh/authorized_keys | |
%end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment