์์ฑ์ : ํํ์ฉ <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.bz2livecd 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
==================== ์ค์น ์๋ฃ ==============================================