์ž‘์„ฑ์ž : ํ•˜ํƒœ์šฉ <bunny> 
 
๋‚˜๋Š” ์ฃผ๋กœ ์ž‘์—…์„ ํ• ๋•Œ๋Š” ๋กœ์ปฌ์—์„œ ํ•˜์ง€ ์•Š๋Š” ์„ฑ๊ฒฉ์ด๋‹ค.
์ฃผ๋กœ SSH ๋กœ ์›๊ฒฉ์ ‘ํ˜นํ•ด์„œ ์ž‘์—…ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ผ๋‹จ ๋ผ์ด๋ธŒ ์”จ๋”” ์‹œ์Šคํ…œ์—์„œ
SSH ์„ค์ •์„ ํ•ด ์ฃผ๊ณ  ์„ค์น˜ ์ž‘์—…์„ ํ•ด์•ผ ํ•œ๋‹ค.
๋ผ์ด๋ธŒ ์‹œ์Šคํ…œ ์•ˆ์— ์žˆ๋Š” SSH ์„ค์ • ํŒŒ์ผ์ด ์•ฝ๊ฐ„ ๋ณด์•ˆ์ด ๋„ˆ๋ฌด ๊ฐ•ํ™”์‹œ์ผœ์„œ ์ ‘์†ํ•˜๋Š”๋ฐ
๋ฌธ์ œ๊ฐ€ ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์ด๋ถ€๋ถ„์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์˜คํ”ˆ ์„ค์ • ํŒŒ์ผ๋กœ ๋ณ€๊ฒฝํ•˜๊ณ  ์„œ๋ฒ„ ๋ฐ๋ชฌ์„ ์žฌ ์‹œ์ž‘ ํ•œ๋‹ค.
< OPENSSH ์„ค์ • >
livecd / # vi /etc/ssh/ssh_config
Host localhost
    ForwardAgent yes
    ForwardX11 yes
Host *
#   ForwardAgent no
   ForwardX11 yes
   RhostsAuthentication no
   RhostsRSAAuthentication yes
   RSAAuthentication yes
   PasswordAuthentication yes
   FallBackToRsh no
   UseRsh no
#   BatchMode no
   CheckHostIP yes
#   StrictHostKeyChecking yes
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_dsa
#   IdentityFile ~/.ssh/id_rsa1
#   IdentityFile ~/.ssh/id_rsa2
   Port 22
   Protocol 2,1
   Cipher blowfish
#   EscapeChar ~
livecd / # vi /etc/ssh/sshd_config
Port 22
Protocol 2,1
#ListenAddress 0.0.0.0
#ListenAddress ::
HostKey /etc/ssh/ssh_host_key
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
ServerKeyBits 768
LoginGraceTime 600
KeyRegenerationInterval 3600
PermitRootLogin yes
IgnoreRhosts yes
#IgnoreUserKnownHosts yes
StrictModes yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog no
KeepAlive yes
SyslogFacility AUTH
LogLevel INFO
#RhostsAuthentication no
RhostsRSAAuthentication no
HostbasedAuthentication no
RSAAuthentication yes
PasswordAuthentication yes
PermitEmptyPasswords no
#ChallengeResponseAuthentication no
#PAMAuthenticationViaKbdInt yes
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#AFSTokenPassing no
#KerberosTicketCleanup no
#KerberosTgtPassing yes
#CheckMail yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
#ReverseMappingCheck yes
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes
livecd / # /etc/init.d/sshd restart
<๋„คํŠธ์›Œํฌ ์ดˆ๊ธฐ ์„ค์ •>
livecd / # net-setup eth0
2  My network is wired  ==> ์„ ํƒ
1  Use DHCP to auto-detect my network settings  ==> ์„ ํƒ
livecd / # /etc/init.d/net.eth0 restart
livecd / # ifconfig eth0
eth0      Link encap:Ethernet  HWaddr xxxxxxxxxxxxxx
          inet addr:192.168.0.3  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: xxxxxxxxxxxxxxx/64 Scope:Link
<์ˆ˜๋™ ์žก๊ธฐ >
=======================================================
livecd ~ # ifconfig eth0 192.168.0.3/24
livecd ~ # route add default gw 192.168.1.1
========================================================
<ํŒŒํ‹ฐ์…˜ ์ƒˆ๋กœ ์ƒ์„ฑ >
livecd ~ # cfdisk /dev/hda
       Name                    Flags                 Part Type            FS Type                         [Label]                      Size (MB)
---------------------------------------------------------------------------------------------------------------------------------------------------------
       hda1                                           Primary             Linux ext3                                                      106.93
       hda2                                           Primary             Linux swap / Solaris                                      921.24
       hda3                                           Primary             Linux ext3                                                    13259.16
       hda4                                           Primary             Linux ext3                                                    15726.74
livecd ~ # mkfs.ext3 /dev/hda1 ; mkswap /dev/hda2 ; mkfs.ext3 /dev/hda3 ; mkfs.ext3 /dev/hda4 ; swapon /dev/hda2
<์ž‘์—… ๋งˆ์šดํ‹ด ์„ค์ •>
livecd ~ # mkdir -m755 /mnt/gentoo/
livecd ~ # mount /dev/hda3 /mnt/gentoo
livecd ~ # mkdir /mnt/gentoo/boot/
livecd ~ # mkdir /mnt/gentoo/chroot
livecd ~ # mkdir /mnt/gentoo/proc/
livecd ~ # mount /dev/hda1 /mnt/gentoo/boot/
livecd ~ # mount /dev/hda4 /mnt/gentoo/chroot/
livecd ~ # mount -t proc proc /mnt/gentoo/proc
livecd ~ # cd /mnt/gentoo
<์†Œ์Šค ๋‹ค์šด๋กœ๋“œ>
livecd gentoo # wget
ftp://gentoo.osuosl.org/pub/gentoo/releases/x86/2008.0/stages/stage3-i686-2008.0.tar.bz2
livecd gentoo # tar xvfj stage3-i686-2008.0.tar.bz2
livecd gentoo # mirrorselect -i -o >> /mnt/gentoo/etc/make.conf
livecd gentoo # cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
<๊ฐ€์ƒ ๋ฃจํŠธ ์‹œ์Šคํ…œ ์‹คํ–‰>
livecd gentoo # chroot /mnt/gentoo /bin/bash
livecd / # env-update
livecd / # source /etc/profile
livecd / # emerge sync
livecd / # cat /etc/make.conf
===================================================================================
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /etc/make.conf.example for a more detailed example.
CFLAGS="-O2 -march=i686 -pipe"
CXXFLAGS="-O2 -march=i686 -pipe"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult
http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="i686-pc-linux-gnu"
=====================================================================================
livecd / # cd /usr/portage
<๋ณธ๊ฒฉ์ ์ธ ์‹œ์Šคํ…œ ์„ค์น˜์™€ ์„ค์ •>
livecd portage # scripts/bootstrap.sh ; source /etc/profile ; emerge system
livecd portage # ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
livecd portage # emerge vim  ;  emerge mc
livecd portage # vi /etc/fstab
====================================================================================
# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>
/dev/hda1       /boot           ext3            noatime         1 1
/dev/hda2       none            swap            sw              0 0
/dev/hda3       /               ext3            noatime         0 0
/dev/hda4       /chroot         ext3            noatime         0 0
/dev/cdrom      /mnt/cdrom      auto    noauto,ro       0 0
/dev/cdrom2     /mnt/cdrom2     auto    noauto,ro       0 0
none            /proc           proc            defaults                0 0
none            /dev/shm        tmpfs           defaults                0 0
=====================================================================================
<์ปค๋„ ์„ค์น˜์™€ ๋””๋ฐ”์ด์Šค ์˜ต์…˜ ์„ค์ •>
livecd portage # emerge -k sys-kernel/gentoo-sources
livecd portage # emerge -k module-init-tools
livecd portage # emerge -k genkernel
livecd portage # cd /usr/src/linux
livecd src # make menuconfig
livecd linux # genkernel all
livecd boot # cp /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage-2.6.27
livecd boot # emerge -k sysklogd
livecd boot # rc-update add sysklogd  default
livecd boot # emerge -k vixie-cron
livecd boot # rc-update add vixie-cron  default
<๋ฃจํŠธ ํŒจ์Šค์›Œ๋“œ ์„ค์ •๋ฐ ํ˜ธ์ŠคํŠธ ์„ค์ •>
livecd boot # passwd
New UNIX password: xxxxxxxxxxxxxxxxx
Retype new UNIX password: xxxxxxxxxxxxxxxxx
passwd: password updated successfully
livecd boot # adduser sunny -d /home/sunny -G users -s /bin/bash
livecd boot # passwd sunny
livecd boot # echo linuxsunny > /etc/hostname
livecd boot # echo linuxsunny.pe.kr > /etc/dnsdomainname
<๋ถ€ํŠธ ๋กœ๋” ์„ค์น˜์™€ ์„ค์ •>
livecd / # emerge grub
livecd boot # vi grub/grub.conf
====================================================================
default 0
timeout 20
title Gentoo
root (hd0,0)/boot/grub/splash.xpm.gz
kernel /boot/kernel-genkernel-x86-2.6.27-gentoo-r7 root=/dev/hda3
initrd /boot/initramfs-genkernel-x86-2.6.27-gentoo-r7
=====================================================================
livecd / # grub
grub> root (hd0,0)
grub> setup (hd0)
<์ตœ์ข… ๋งˆ๋ฌด๋ฆฌ ํ•˜๊ณ  ๋ฆฌ๋ฌดํŒ…>
livecd / # etc-update
livecd / # exit
livecd gentoo # cd ..
livecd mnt # umount /mnt/gentoo/boot
livecd mnt # umount /mnt/gentoo/proc
livecd mnt # umount /mnt/gentoo/chroot/
livecd mnt # umount /mnt/gentoo
livecd mnt # reboot
====================  ์„ค์น˜ ์™„๋ฃŒ ==============================================

+ Recent posts