2007년 4월 29일 일요일

[Kubuntu] root 로그인 활성화하기

Kubuntu를 처음 접했을 때 가장 황당했던 부분이 바로 root로 로그인이 안된다는 점이었다. 이미 설치과정에서 root password를 묻지 않는 점도 이상했었지만 그 당시에는 이런 이유때문이었다는 것을 바로 감지할 수는 없었다.

Windows Vista의 UAC처럼 그 취지는 이해하지만 default로 이렇게 지정해 놓은 것은 상당히 곤란한 일이다.

예전의 Linux관련 책들에는 대부분 설치완료 후 첫 Login은 root로 하는 것에 대한 부분이 있었는데 옛이야기가 되어 버렸다.

root가 비활성화되어 있으면 그만큼 Hacking하기는 쉽지 않다는 것과 sudo를 가지고 할 수 없는 일은 없다는 점은 인정하지만 너무 불편하다.

CentOS 5의 경우는 default로 run level이 3으로 지정되어 있고 만약에 run level 5로 부팅하면 root Login이 허용되지 않는다.

이 조치는 역시나 불편함이 있지만 나름대로 상당히 합리적이다.

또한 run level 3에서 root로 로그인하고 startx하면 root계정에서 x-window 화면을 얻을 수 있기때문에 그다지 불평할만한 것은 아니다.

서론이 길었는데 기본 설정이 저렇게 되어있다하여 root계정을 사용하는 방법이 없는 것은 아니다. 사실은 아주 간단하다.

우선 root password를 설정한다.
$ sudo passwd root

그리고 /etc/kde3/kdm/kdmrc 이 file을 수정하면 된다.
$ sudo vi /etc/kde3/kdm/kdmrc

고쳐야 할 부분은 AllowRootLogin 항목이다.
false로 되어있는 것을 true로 바꾸어 준다.

수정된 문서를 저장하고 나면, 로그아웃한 다음 root로 Login할 수 있다.


2007년 4월 28일 토요일

[Tip] ISO-image 사용하기


Linux에서 Storage Device는 Directory에 mounting을 해서 사용하게 된다.

ISO 이미지도 mounting을 해서 사용할 수 있다.

보통 default설정에서 mounting은 root만이 가능하다.

우선 Mount Point가 필요하므로 예를 들면 /mnt/iso와 같은 Directory를 만들어둔다.

$ su
password:

# mkdir /mnt/iso

# mount -t iso9660 -o loop /home/jvm/image.iso /mnt/iso
(-t : type - iso9660, -o loop : option - using a loop device)

Mount를 해제하려면
# umount /mnt/iso

CD로부터 직접 이미지를 만드려면 mkisofs라는 프로그램을 쓰면된다.
Mount되어 있는 CD로부터 image.iso를 만든다.
# mkisofs -o image.iso /mnt/cdrom

cue + bin 을 iso로 변환하려면 bchunk를 쓴다.
# bchunk image.bin image.cue iso.iso
해주면 image.bin을 iso.iso로 변환할 수 있다.

howto make your mouse to fully use all the buttons.

X에서 5버튼 마우스 쓰기

우선 /etc/X11/xorg.conf에 마우스 부분을 다음과 같이 편집한다.

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Device" "/dev/mouse"
Option "Protocol" "ExplorerPS/2"
Option "Buttons" "7"
Option "ZAxisMapping" "6 7"
EndSection

다음 imwheel을 emerge 한다.

emerge imwheel

자신의 홈디렉토리에

.imwheelrc 파일을 만들고 다음과 같이 기록한다.

".*"
None, Up, Alt_L|Left
None, Down, Alt_L|Right

.xinitrc 파일에 다음 두줄을 추가한다.

xmodmap -e "pointer = 1 2 3 6 7 4 5"
imwheel -k -b "67"&

X를 다시 시작하면 사이드 버튼이 웹브라우저에서 앞으로가기 뒤로 가기로 동작함을 확인할 수 있다.

자세한 원문은 아래 주소를 참조하면 된다.
http://forums.gentoo.org/viewtopic-t-98028-highlight-microsoft+optical+button+mouse.html



linuX-gamers.net - Howtos - LOGITECH MX518


Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Device" "/dev/input/mice"
Option "Buttons" "10"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "false"
Option "ButtonMapping" "1 2 3 6 7 8 9 10 4 5"
EndSection



Section "InputDevice"
  Driver       "mouse"
  Identifier   "Mouse[1]"
  Option       "Buttons" "4 5"
  Option       "ButtonMapping" "1 2 3 4 5"
  Option       "Device" "/dev/input/mice"
  Option       "Name" "Microsoft IntelliMouse Optical"
  Option       "Protocol" "explorerps/2"
  Option       "Vendor" "Sysp"
  Option       "ZAxisMapping" "4 5"
  Option       "one page back" "4"
  Option       "one page forward" "5"
EndSection

2007년 4월 14일 토요일

[Terms] IX(Internet eXchange) 인터넷 연동

IX (Internet exchange): 인터넷 연동 / 인터넷 교환 노드

IX는 IXP(IX Point)라고도 불리며, 서로 다른 ISP 간의 트래픽을 원활하게 소통시키기 위한 인터넷 연동 서비스를 가리킨다. IX는 원래 ISP 간의 상호접속을 목적으로 설립된 NOC에 각 공급자가 회선을 끌어와서 공동 이용함으로써, 회선 비용을 낮추면서 불필요한 트래픽 중계를 줄이기 위한 목적으로 설치되었다.

IX는 NOC에 설치된 기기에 따라 대개 두 가지 종류로 나뉘어지는데, 하나는 NOC 내에 한 대의 라우터를 설치하고 여기에 각 ISP가 도입한 라우터를 접속하는 "레이어3 방식"이며, 다른 하나는 각 ISP의 라우터 사이를 스위칭 허브 등으로 접속하는 "레이어2 방식"이다. 그러나, 레이어2 방식의 운영이 더 용이하므로, 현재는 레이어2 방식이 주류를 이루고 있다.

출처 : www.terms.co.kr/IX.htm

첨부파일 :  한국전산원 손영태(정보통신기술사) "인터넷망 연동(IX) 현황 및 이슈"


[Terms] Backplane

Backplane

    Physical connection between an interface or card and the data buses and the power distribution buses inside a chassis


from Cisco Systems Terms & Acronyms

2007년 4월 11일 수요일

SuSE Rescue System을 사용하여 GRUB복구하기

SuSE 리눅스에서는 Rescue모드로 부팅해서 GRUB을 복구하려면 다음과 같은 과정을 거친다.
설치 DVD나 CD1로 부팅하면 나오는 메뉴 가운데 Rescue System을 선택한다.
부팅이 완료되어 Rescue login: 이라고 나오면 root로 로그인한다.
패스워드는 요구되지 않는다.
이렇게 얻은 Resue:~ # 프롬프트에 grub을 입력하면 grub>프롬프트를 얻는다.

grub> find /boot/grub/stage1

(hd0,6)
find 명령을 부팅 가능한 파티션을 찾기 위해 사용.

grub> root (hd0,6)
root 파티션 설정.

grub> setup (hd0,6)
Grub을 hda7에 설치.

grub> quit

Resue:~ # reboot

2007년 4월 5일 목요일

부트로더 GRUB 설치에러 복구하기

근래 데스크탑에 SuSE Linux Enterprise Server10, Kubuntu 6.10, Ubuntu 6.10, Fedora Core 6을 설치하려 하였으나 모두 실패하였다. Red Hat Enterprise AS4의 경우 입수한 iso가 깨진 것인지 DVD가 부팅이 되지 않았다.

Kubuntu처럼 설치 도중 진행이 멈춰버리 경우 외에는 항상 아래와 같이 부팅에 문제가 있었다.

GRUB Loading stage2...... 후에 부트메뉴가 아니라

grub> 프롬프트가 나와버린다. (1)

부트로더 설치 중에는 아무런 오류가 발생하지 않았다.

설치 프로세스 중에서 GRUB이 제대로 설치되지 않은 것으로 보인다.


현재 하드와 보드의 건강상태를 확신할 수 없는 상태이고 나름대로 석연치 않은 징조도

이미 오래 전부터 보이고 있는 지라 무턱대고 삽질을 해서 해결을 볼 상황도 아니다.


일단 이를 확인하기 위해서 Rescue 모드로 부팅을 한다.

여기에선 Fedora Core 6의 설치DVD를 이용해 Rescue 모드에 들어갔다.

이미 설치되어 있는 시스템은 /mnt/sysimage에 마운트된다.

chroot /mnt/sysimage명령을 사용하면 이 시스템을 쉘에서 사용할 수 있게 된다.

들여다 보면 /boot/grub/ 하위의 파일들이 정상적으로 존재하지 않을 것이다. 필요한 파일이 존재하지 않다거나 파일 사이즈가 0인 경우 등일 수 있다.

하지만 내 시스템에서는 다 정상으로 보였다. 커널이미지 파일도 정상적인 것 같고 설정파일들도 정상인데.

하드디스크의 부트섹터에 write하는 데에 문제가 있는 것이 아닌지.....

(윈도우스의 복구모드에서 fixmbr을 실행하면 grub은 지워지고 기존의 윈도우스 부트로더로

돌아는 데에는 아무런 문제가 없다.)


이 경우 해볼 수 있는 방법은 다음과 같이,

배포판 CD의 Rescue 모드로 부팅하여, 'grub-install /dev/hda‘ 명령으로 GRUB을 재설치 하는 것이다.

grub-install은 쉘스크립트로 그 대신 다음과 같이 세부명령을 사용할 수도 있다.

/sbin/grub명령으로 GRUB 프롬프트를 얻는다.

grub> root (hd0,2)          # for hda3

grub> setup (hd0)          #  GRUB을 hda의 mbr에 설치

grub> quit


(1). GRUB 프롬프트에서도 다음과 같은 방법을 통해 기존의 커널로 부팅할 수 있다

grub> root (hd0,2)

grub> kernel /boot/vmlinuz-2.x.x-x.x.fc6

grub> boot

VPN-Client-Installation unter Linux(OpenSuSE 10.2)

Voraussetzungen
  • Kernel 2.2.12 oder neuer
  • Glibc 2.1.1 oder neuer
  • libstdc++
  • Installierte Kernel-Quellen (das Installationsskript muss ein zum Kernel passendes Modul kompilieren).
  • Firewall:
    Wenn Sie eine Linux-Firewall betreiben, müssen Sie sicherstellen,
    dass folgende TCP-Ports und IP-Protokolle freigeschaltet werden:
    * UDP-Port 500 (IKE: Internet Key Exchange)
    * UDP-Port 10000 (IPSec Transport über UDP)
    * IP-Protocol 50 (ESP:Encapsulating Security Payload)
    * TCP-Port 10000 (IPSec Transport über TCP)
    * NAT-T (Standards-Based NAT Transparency) Port 4500

Der Cisco-Client besteht aus einigen Kommandozeilen-Programmen: eine graphische Oberfläche wie bei Windows gibt es nicht. Alle Aktionen (Installation, Verbindungsauf- und -abbau) müssen daher an der Konsole oder in einem Terminal durchgeführt werden.

Installation

Die Installation ist als Benutzer root auszuführen.

  1. Archiv in einem temporären Verzeichnis entpacken:
    tar xzf vpnclient-linux-4.0.1.A-k9.tar.gz
  2. In das erstellte Verzeichnis wechseln:
    cd vpnclient
  3. Installationsskript starten:
    ./vpn_install
  4. Das Skript stellt jetzt einige Fragen zur Installation. Im Normalfall kann man hier einfach mit "Return" den Vorschlag übernehmen.
    • Directory where binaries will be installed
      In dieses Verzeichnis werden cvpnd, vpnclient, ipsec_log und cisco_cert_mgr installiert.
    • Automatically start the VPN service at boot time
      Wenn hier mit "no" geantwortet wird, muss vor dem Aufbau einer VPN-Verbindung "
      /etc/xxx/vpnclient_init start" ausgeführt werden (xxx steht je nach Distribution für "init.d", "rc.d" oder "rc.d/init.d").

Achtung Suse-Benutzer: Bei dieser Frage antworten Sie mit no, da die Startup-Scripts möglicherweise an falscher Stelle installiert werden. Wollen Sie den VPN Client beim Booten aufstarten, verwenden Sie statt dessen nach der Installation

ln -s /etc/init.d/vpnclient_init /etc/init.d/rc3.d/S85vpnclient_init
ln -s /etc/init.d/vpnclient_init /etc/init.d/rc5.d/S85vpnclient_init

Zusätzlich editieren Sie das File /etc/init.d/vpnclient_init und fügen Sie ca. an Zeile 15 (ans Ende des ersten Komentarblockes) die Zeile ein (inklusive #-Zeichen):

# Required-Start: splash_late

    • Directory containing linux kernel source code
      Wenn hier kein Vorschlag kommt, sind wahrscheinlich die Kernelquellen nicht installiert. In diesem Fall sollte das Skript mit "Strg-C" abgebrochen, die Kernelquellen installiert und dann das Installationsskript wieder gestartet werden.

Anschließend bestätigt man die gemachten Angaben noch einmal.

  1. Das Installationsskript erstellt jetzt das Modul und kopiert die Dateien.
  2. Die vom Installationsskript vergebenen Zugriffsrechte sollten noch korrigiert werden: /etc/opt/cisco-vpnclient für jeden schreibbar ist. Sinnvollere Rechteregelungen sind z.B.:  (/etc/CiscoSystemsVPNClient = /etc/opt/cisco-vpnclient)
    • Verzeichnis kann von allen Mitgliedern der Gruppe "users" gelesen und geändert werden:
      chown -R root.users /etc/CiscoSystemsVPNClient
      chmod -R ug=rwX,o= /etc/CiscoSystemsVPNClient
    • Verzeichnis kann nur von root geändert werden, Benutzer der Gruppe "users" können lesen:
      chown -R root.users /etc/CiscoSystemsVPNClient
      chmod -R u=rwX,g=rX,o= /etc/CiscoSystemsVPNClient

Eventuell vorhandene Zertifikate (die nach der Installation nicht vorhanden sind und für den TU-Zugang nicht gebraucht werden) sollten Sie außerdem gegen unbefugtes Lesen schützen.

Anschließend kann der VPN-Dienst per Hand mit "/etc/init.d/vpnclient_init start" gestartet werden.

Mobiler Netzzugang

- IP-Adresse des internen Gateways für Wireless-LAN, Netzwerksteckdosen : vpngw1.net.hrz.tu-darmstadt.de

- DNS-Name des externen Gateways Zugang über einen Internet-Provider (ISP) in das TUD-Netz : dialin.tu-darmstadt.de

- IPSec-Gruppenname : mobiletu

- IPSec-Secret : tu2go

Wenn Sie sich bereits einen noch nicht konfigurierten Cisco-VPN-Client geladen haben, so können Sie sich dafür noch folgende vorkonfigurierten Profile hier laden. In den vorkonfigurierten VPN-Clients (d.h. TUD-Version) sind diese Profile bereits enthalten.

Diese Dateien müssen Sie dann im Profile-Verzeichnis des Cisco-VPN-Clients speichern:

  • Windows: c:\Programme\Cisco Systems\VPN Client\profiles\
  • Linux: /etc/CiscoSystemsVPNClient/Profiles/
  • Die Zugriffsrechte sollten noch etwas angepaßt werden:
    chmod 755 /etc/CiscoSystemsVPNClient
    chmod 755 /etc/CiscoSystemsVPNClient/Profiles
    chmod 644 /etc/CiscoSystemsVPNClient/Profiles/campus.pcf

Verbindungsaufbau

Vor dem Verbindungsaufbau muss der VPN-Client möglicherweise mit "/etc/init.d/vpnclient_init start" (s. o.) gestartet werden.

Führen Sie "vpnclient connect campus" oder "vpnclient connect extern" aus. Anschließend wird nach Benutzernamen und Paßwort gefragt.

Zum Verbindungsabbau geben Sie "vpnclient disconnect" ein.

·  Achtung:
Unter Versionsnummern 4.6 und 4.7.00.640 (ev. auch späteren) : Wenn man versucht den Klient als normaler User zu starten, kommt es zu der Fehlermeldung:

privsep: unable to drop privileges: group set failed.

Loggen Sie sich stattdessen als root ein:

xc1@tphiwi:~> su -

Password:

tphiwi:~ # vpnclient connect campus

 

Cisco VPN-Client ohne Root-Rechte ausführen
Um die Fehlermeldung:
"privsep: unable to drop privileges: group set failed" auszuschließen, loggen Sie sich als root ein (siehe oben) und geben Sie in der Konsole
chmod 4111 /opt/cisco-vpnclient/bin/cvpnd ein.
Dadurch verschwindet nicht nur die Fehlermedlung, sondern der VPN-Client kann auch ohne Root-Rechte ausgeführt werden.

·  Im danach folgenden Dialog werden die URZ-Nutzerkennung/Login-ID und das URZ-Unix-Kennwort abgefragt. Ob danach die Verbindung hergestellt ist, kann man an den weiteren Ausgaben ablesen.

·  Das Konsolenfenster muss solange geöffnet bleiben, wie die IPsec-Verbindung ins URZ benötigt wird. Mit Abbruch des vpnclient wird auch die sichere Verbindung unterbrochen.

·  Der Status der Verbindung und die IP-Adresse kann in einem anderen Fenster auch jederzeit mit

vpnclient stat

abgefragt werden.

2007년 4월 4일 수요일

[Kubuntu] change GRUB Splash

1) Create a GRUB image directory and move the new image file into it.

sudo mkdir /boot/grub/images

sudo mv $LOCATIONDIR$/WidescreenKubuntuBootSplash.xpm.gz /boot/grub/images

2) Change the GRUB menu file to load the image. Remember to backup first!

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.old

sudo kwrite /boot/grub/menu.lst

Find the following:

# Pretty colours
#color cyan/blue white/blue

Add there:
splashimage=(hdX,Y)/boot/grub/images/WidescreenKubuntuBootSplash.xpm.gz

NOTE: Replace X and Y with the proper numbers! X in this case is the actual disk drive and Y is the partition.(for hda7:hd0,6) Assuming you have a pretty standard installation of Kubuntu, you could find this information further down in menu.lst. Locate the section which matches the entry you normally boot from:

## ## End Default Options
## title Kubuntu, kernel 2.?.??-?-??
root (hdX,Y)

There you can find the proper numbers to use for your splashimage command. Enter those in the line added before. If you have a separate boot partition, you have to remove the /boot in the path, this is because the root of the boot partition is mounted in /boot on your other partition. Resulting in this section instead:

splashimage=(hdX,Y)/grub/images/WidescreenKubuntuBootSplash.xpm.gz

3) Update GRUB.

sudo update-grub

Restart

2007년 4월 3일 화요일

[Kubuntu] xorg.conf modification for A6Va(Mobility Radeon x700 IGP)

My Laptop Asus A6Va의 그래픽 카드는 ATI의 Mobility Radeon X700 IGP이고 128MB의 비디오 메모리를 가지고 있다. 여기에 Kubuntu 6.10을 설치하려 하니 blank화면만 나타나서 설치를 진행할 수가 없었다. 같은 현상을 이미 Fedora Core5를 설치하려고 했을 때 겪은 적이 있다. OpenSuSE 10.1과 10.2의 경우 이러한 문제가 나타나지 않았다.
혹시나 해서 외부모니터를 연결해보니 설치화면을 볼 수 있다. 일단 외부 모니터를 연결한 채로 Kubuntu를 설치한 다음 해결책을 찾아보았다.
생각보다 여러 군데에 이에 관한 글들이 있는 것을 보니 이미 많은 사람들이 비슷한 일을 겪은 것 같다.
www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com에 다음과 같은 해결책이 올라와 있었다.
[Bug 94922] boot live cd on notebook ASUS A6Va doesn't start x
>Public bug reported:
>
>on my notebook with Ati X700 mobility and LCD 1280x800 the system load but >with a blank screen.
>To resolve problem i must log in in text mode and:
>1) pkill kdm
>2) Edit xorg.conf and add:
>   in section "Monitor" Option "MonitorLayout" "LVDS,AUTO"
>   in resolution add "1280x800"
>3) start kdm


나의 경우 Live CD는 정상적으로 보여지고 문제는 인스톨을 시작하고 나서이지만 다른 사람들의 경우 설치완료 후 첫 부팅에서 문제가 발생하는 경우가 많은 것 같다.
해결책은 두가지가 있었다.
하나는 ATI에서 제공하는 드라이버로 변경하는 것이고, 또 하나는 (K)Ubuntu 배포본에 포함된 오픈소스 드라이버를 사용하는 방법이다. 여기에서 사용하는 방법은 이 두번째 방법이다.
오픈소스 드라이버를 사용하는 쪽이 3D가속성능에서 유리하다고 한다.

일단 부팅을 하면 blank화면밖에 볼 수 없으므로 Ctrl+Alt+F1을 눌러 Console화면을 연다.
로그인한 다음 위에 나온대로 해주면 된다.
나는 xorg.conf를 다음과 같이 수정하였다.

Section "Device"
  identifier "ATI Technologies, Inc. Radeon Mobility X700 (RV410 PCIE)"
  busid "PCI:1:0:0"
  driver "ati"
EndSection

Section "Monitor"
  identifier "Generic Monitor"
  Option "MonitorLayout" "LVDS,AUTO"
EndSection

Section "Screen"
  Identifier "Default Screen"
  Device "ATI Technologies, Inc. Radeon Mobility X700 (RV410 PCIE)"
  Monitor "Generic Monitor"
  DefaultDepth 24
  SubSection "Display"
    depth 24
    modes "1280x800@60"
  EndSubSection
EndSection

그리고 재시작하니 x윈도우가 정상적으로 동작하였다.

[Kubuntu] root 와 sudo

[Source] Ubuntu Documentation Project

root 권한을 필요로 하는 프로그램을 실행하였을 때, sudo 는 여러분의 일반 사용자 패스워드를 입력할 수 있도록 물어볼 것입니다.

명령어 줄에서 sudo를 사용하려면 실행할 명령어 앞에 "sudo" 라고 간단히 입력하십시오. 그러면 당신의 패스워드를 물을 것입니다.

sudo는 잠깐 동안(기본 설정은 15분) 당신의 암호를 기억할 것입니다. 이것은 사용자가 여러 가지 관리 작업을 하는 동안 매번 암호를 묻지 않게 하기 위해서 이렇게 설계되었습니다.

sudo 사용할 때 다른 팁:

  • "root" 터미널을 사용하려면 명령어 줄에서 "sudo -i" 라고 입력하십시오

  • 쿠분투의 기본 그래픽 설정에서 전체 그룹은 sudo를 사용합니다. 그래서 sudo의 그래픽 프론트엔드 프로그램인 kdesu를 사용할 때에는 당신의 패스워드가 필요할 것입니다.

  • For more information on the sudo program and the absence of a root user in Kubuntu, read the sudo page on the Ubuntu wiki.

root 권한으로 프로그램을 수동으로 시작하기

때때로 root 권한으로 프로그램을 실행하는 게 필요합니다. 이것은 Run Command 대화상자를 이용하면 쉽습니다.

  1. Open the Run Command dialog by typing: Alt-F2

  2. 실행하고 싶은 프로그램의 이름을 쓰고, 앞에 kdesu를 붙이고 Enter를 누르면 된다. 예를 들어, 파일 관리자 퀀쿼러를 root 권한으로 실행시키고 싶다면 다음과 같이 입력.

    kdesu konqueror

2007년 4월 2일 월요일

The Versions of Red Hat Enterprise

  • Red Hat Enterprise AS : is best suited for servers that have more than 2 CPUs with greater than 8GB of system RAM. There is support for many different types of CPUs as well, such as the IBM iSeries, pSeries, and zSeries.
  • Red Hat Enterprise ES : supports up to 2 CPUs and 8GB of system RAM. ES does not provide the same level of support as AS.
  • Red Hat Enterprise WS : provides nearly the same functionality as Desktop. The magor difference between WS and Desktop is the number of CPUs supported. WS supports up to 2 CPUs.
  • Red Hat Enterprise Desktop : supports a system with 1 CPU and up to 4GB of system RAM.

p.s. RHEL의 무료버전이랄 수 있는 CentOS도 있다.