블로그 이미지
Flying Mr.Cheon youGom

Recent Comment»

Recent Post»

Recent Trackback»

« 2024/5 »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

 
 

우분투 원격 부팅 설정

보안/서버관리 | 2011. 12. 17. 13:53 | Posted by youGom

ethtool -s eth0 wol g



-------------------------------------------------------------------------------------------------------

HOWTO: Set your system up for Wake On LAN (WOL)

This is really common, but I haven't seen a ubuntu howto for it, people more or less peice it together from posts and blog entries and the like.

So, here it goes. First off, make sure your system supports WakeOnLAN (WOL), if you know your system well, you already know if it does or doesn't.

--

Automatic way:
This script does everything described in the Manual way, for you, except step 1 and step 4.
------------------------

The automatic method is super dialup friendly! thanks to gzip compression the filesize is a mere 1.5kb! almost half the extracted size of 3.4kb!


1. If you havent already, go to your BIOS, and turn on WakeOnLAN (it varies, look for it.) If your network card is onboard, your set for step 2, otherwise there is probably a cable that should go from your network card to your motherboard, though this is not always the case.


Before continuing, note the interface you want to do this to. Most people know how to do this, if you do not, look at step 2a of the manual method.

2. Download and extract this: You can do it with the GUI and run the extracted program in a terminal by double clicking it, or open a terminal and do the following:

**** Removed dead link ****

3. As the exit of the program notes, now you just need to get/use a wake on lan sending program, like wakeonlan.

4. Sit on your lazy *** and have fun

--

Manual way:
------------------------
1. If you havent already, go to your BIOS, and turn on WakeOnLAN (it varies, look for it.) If your network card is onboard, your set for step 2, otherwise there is probably a cable that should go from your network card to your motherboard, though this is not always the case.

2. Back in ubuntu, kubuntu, xubuntu, w/e, we now need to make a script that will run every time the computer is started, because this command only lasts until the computer is turned on again once.

2a. Find out what network device you want to have the computer wake-able from, usually all, which is just one. If you have more network devices in your system, 9 chances out of 10, you already know what they are called.
You can NOT wake up a laptop or computer that is only connected via wireless with wake-on-lan, unless the bios has a method for this, this is very rare, and I do not garuntee this howto will work in such cases.
In your terminal, type:
Code:
ifconfig
You'll get something like: (I have removed my mac address for security)
Code:
eth0      Link encap:Ethernet  HWaddr 01:23:45:67:89:ab
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::215:f2ff:fe6f:3487/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:71495 errors:0 dropped:0 overruns:0 frame:0
          TX packets:76190 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:23164212 (22.0 MiB)  TX bytes:7625016 (7.2 MiB)
          Interrupt:217 Base address:0xd400

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1290 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1290 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:161182 (157.4 KiB)  TX bytes:161182 (157.4 KiB)
So, I want this system to be wake-able from eth0.

2b. Now we create the script.
Note: you must be an administrator on the system you are doing this to.
Code:
sudo -i
Enter your password at the prompt.
Change to the startup script directory and start editing a new file:
Code:
cd /etc/init.d/
pico wakeonlanconfig
Paste, or type this into the file, replacing eth0 with your network device, repeat the ethtool line as many times for your devices before the exit line:
Code:
#!/bin/bash
ethtool -s eth0 wol g
exit
Set the permissions of the file:
Code:
chmod a+x wakeonlanconfig
Make the script run on startup:
Code:
update-rc.d -f wakeonlanconfig defaults
You should see something like:
Code:
 Adding system startup for /etc/init.d/wakeonlanconfig ...
   /etc/rc0.d/K20wakeonlanconfig -> ../init.d/wakeonlanconfig
   /etc/rc1.d/K20wakeonlanconfig -> ../init.d/wakeonlanconfig
   /etc/rc6.d/K20wakeonlanconfig -> ../init.d/wakeonlanconfig
   /etc/rc2.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig
   /etc/rc3.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig
   /etc/rc4.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig
   /etc/rc5.d/S20wakeonlanconfig -> ../init.d/wakeonlanconfig
Now we finish by running it, and making sure there are no errors.
Code:
/etc/init.d/wakeonlanconfig
This should produce no output and put you right back at the prompt you started at.

3. Use it. you'll need something to send wake-on-lan packets with, "wakeonlan" is in the repos. And you'll need the mac address of the system.

To get your MAC address, on the same system you just enabled WOL on, type:
Code:
ifconfig | grep HW
its the thing that looks like 01:23:45:67:89:ab , write it down.
turn off that system:
Code:
sudo halt
if your using wakeonlan from the repos, and you are on the same network as the computer your tying to wake up, replace 01:23:45:67:89:ab with your mac address and do, from another computer:
Code:
wakeonlan 01:23:45:67:89:ab
In MOST cases, you CAN SEND wake on lan packets from a wireless connected computer.
If that doesnt work, its likely the port on the system your trying to wake up isnt the default (9), try 7, or if your BIOS settings or book told you one, use that one.
Code:
wakeonlan -p 7 01:23:45:67:89:ab
If that STILL doesnt work, make sure wakeonlan is enabled in your bios and your hardware supports it.

*Note: It has been said that you need to disable -i from halt, however I have never had to do this, nor do I know how.

4. Sit on your lazy *** and have fun

Feel free to post any questions, suggestions, problems and I will tend to them ASAP.

Added notes:
* For this to work, most systems must be shut down properly, ie: with the power button or halt, or any of the ways to shut down. Unclean power-offs (like a power outage or holding the power button for 5s) seem to stop WOL from working untill the system is powered on and shut down properly. Though, there my be a few exceptions. This is a hardware issue with the BIOS. In my opinion, WOL should work regardless of how the system is powered off, but thats not the case. I suggest, if you have frequent power outages, that you have your BIOS set to Power ON after a power failure, most new systems allow this.
:

apache2 디렉토리 인덱싱 안되게 하기

보안/서버관리 | 2011. 12. 16. 17:56 | Posted by youGom

웹서버를 설치 하고 나면 기본적으로 index.html 파일이 생성되면서
"It Work!" 라는 단어를 출력한다.
하지만 그 index 관련 파일이 없게 되면
index of ~ 와 함께 그 폴더에 있는 모든 파일을 다운로드 가능하게 열람 할 수 있다.
이는 보안적 측면에서 너무나 취약한 점이다.

이를 막기 위해서 다음과 같은 파일을 수정해 주면 된다.

/etc/apache2/mods-available/userdir.conf 파일에 존재하는 

<Directory /home/*/public_html>
                AllowOverride FileInfo AuthConfig Limit Indexes
#               Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
                Options MultiViews SymLinksIfOwnerMatch IncludesNoExec

                <Limit GET POST OPTIONS>
                       Order allow,deny
                        Allow from all
                </Limit>
                <LimitExcept GET POST OPTIONS>
                        Order deny,allow
                        Deny from all
                </LimitExcept>
        </Directory>

위와 같이 Indexes 를 없애주면 된다.

출처 : http://gmyoul.tistory.com/entry/apache2-디렉토리-인덱싱-안되게-하기

:

개인도메인만들기/네임서버설정

보안/서버관리 | 2011. 12. 16. 17:54 | Posted by youGom

/개인도메인등록 과정이 끝나면, 이 도메인을 홈페이지가 있는 호스트로 연결하기 위하여 최소 하나의 네임서버에 이 도메인을 위한 엔트리를 설정해 주어야 한다.

1. 상황
2. 어느 네임서버를 이용할 것인가
3. 네임서버 설치와 설정
3.1. /etc/named.conf 변경
3.2. /var/named/zone-gypark.pe.kr 추가
3.3. 네임서버 구동
4. 네임서버 동작 확인

[edit]1. 상황

  • 도메인 : gypark.pe.kr
  • 실제주소 : http://HHHHHH.snu.ac.kr/~gypark새 창으로 열기
  • 실제호스트 : HHHHHH.snu.ac.kr (147.46.15.HHH)
  • 네임서버 : NNNNNN.snu.ac.kr (147.46.15.NNN)

[edit]2. 어느 네임서버를 이용할 것인가

문제는 어느 네임서버에서 그 설정을 해 줄 것인가 하는 점. 크게 네 가지 길이 있었다.

  • 서울대 네임서버 (147.46.80.1,147.46.80.2) 를 사용
    • 호스트가 서울대 내에 있는 것이기 때문에, 호스트가 위치한 전산망의 공식 네임서버를 사용하는 것이니 개념상 꽤 합당해보였다.
    • 전산원에서 관리하는 학내 공식 서버인만큼, 안정성이 보장된다.
    • but, 전산원에 전화로 문의한 결과, 서울대 전산원에서는 snu.ac.kr 로 끝나는 도메인 이외의 다른 도메인을 사용하는 것은 지원을 해 줄 수 없다는 답변을 받았다. 이 때 처음 알았는데, 학내에 있는 호스트에 다른 도메인을 사용한 경우는 전부 몰래(?) 하는 것이고, 전산원에서는 현재는 이를 묵인하고 있지만, 나중에 정책 변경 여하에 따라 이런 경우를 적발하여 차단할 수 있다고 한다.

  • 외부 업체에서 제공하는 도메인 포워딩을 이용
    • (주)아이네임즈에서는 도메인 포워딩 서비스에 별도의 이용료를 받고 있었고, (주)아사달에서는 무료로 서비스를 제공하고 있었다. 그래서 일단 아사달에 회원 가입을 하고, 도메인 포워딩 서비스를 신청하였다.
    • /개인도메인의네임서버지정 과정을 통해서, 내 도메인의 네임서버를 아사달에서 공지한 네임서버로 설정하였다. (p1.asadal.net 211.233.39.186 , p2.asadal.net 211.233.38.28)
    • but, 결과가 상당히 불만족스러웠다. "유동 포워딩"과 "고정 포워딩" 두 가지 방식 중에서 선택할 수 있도록 되어 있었는데, 유동 포워딩 방식에서는, 웹브라우저의 주소창에 gypark.pe.kr 을 입력하면 그 주소를 실제 주소로 변경하여 refresh 하는 방식이다. 따라서 주소창에 실제 주소가 나타나 버린다. 고정 포워딩 방식에서는, gypark.pe.kr 로 접속했을 때 아사달 측의 서버에서 하나의 프레임으로 구성된 프레임셋을 출력하고, 그 프레임 안에 실제 주소의 페이지를 집어넣는 방식이다. 주소창의 도메인은 바뀌지 않지만, 내부에 있는 링크들은 모두 원래의 주소 그대로 나온다. 게다가 두 방식 모두, gypark.pe.kr/DateBK5/index.html 과 같이 하위 디렉토리나 파일을 직접 주소에 적어서 억세스하는 것이 불가능하다.

  • 다른 네임서버를 이용
    • 누군가의 컴퓨터에 설치되어 동작하고 있는 네임서버를 이용하는 방법
    • 실제로 특정한 동호회나 동문회 사람들끼리 하나의 네임서버를 운영하여 구성원들의 도메인을 담당하게 하는 경우를 볼 수 있다.
    • but, 네임서버 관리자와 친분이 있지 않으면 부탁하기 힘들다. :-) 게다가, 그 네임서버의 안정성을 신뢰하기 힘들다.

  • 홈페이지가 있는 서버 (HHHHHH.snu.ac.kr) 에서 직접 네임서버를 운영
    • 네임서버 관리의 권한이 연구실에 있으므로 설정 변경 등을 맘대로 할 수 있다.
    • 네트웍 안정성이 큰 문제가 되지 않는다. (네임서버가 접속이 안 되는 상황이라면 어차피 홈페이지도 접속이 안 된다는 것이니..)
    • but, 네임서버 설정하는 것에 전혀 문외한이었고, 무엇보다도 네임서버는 외부 공격에 매우 취약하여 보안상 문제점이 많다. 웬만한 해킹 사례를 보면 bind 나 기타 nameserver 의 헛점을 노렸다는 얘기는 빠지지 않고 나온다. 항상 보안 관련 뉴스에 귀기울여야 함.

처음에는 네번째 방법, 즉 HHHHHH에 직접 네임서버를 설치하는 것을 택했는데, HHHHHH가 연구실에서 꽤 중요한 비중을 차지하는 서버이기 때문에 아무래도 맘에 걸려서, 세번째 방법과 결합하였다. 즉 연구실 내 다른 서버(NNNNNN)에 네임서버를 설치하고 운영하기로 하였다.

[edit]3. 네임서버 설치와 설정

NNNNNN 에는 레드햇 리눅스가 설치되어 있었고, bind-9.*.* 이 이미 설치되어 있었다. 따라서 설정만 변경해 주고 구동하면 되었다. (소스를 직접 컴파일하는 경우는 http://www.isc.org새 창으로 열기 에서 최신 버전을 다운로드 할 수 있다. (이 사이트는 하나로통신을통해접속할수없는웹사이트들 중 하나이다.)

다음의 화일들을 수정 또는 추가하였다. 전혀 모르는 상태에서 여러 웹사이트들을 뒤지면서 끙끙대었음...

[edit]3.1. /etc/named.conf 변경

options {
    directory "/var/named";
    /*
     * If there is a firewall between you and nameservers you want
     * to talk to, you might need to uncomment the query-source
     * directive below.  Previous versions of BIND always asked
     * questions using port 53, but BIND 8.1 uses an unprivileged
     * port by default.
     */
    // query-source address * port 53;
    // 아래 네 줄을 추가
    allow-transfer { none; };   // 다른 네임서버에서 zone 설정을 가져가지 못하게 한다
    allow-query { none; };      // 기본적으로 모든 네임서버 질의에 응답하지 않는다. 
                                // 따라서 이 서버를 DNS 서버로 지정하여 사용할 수는 없다.
    recursion no;               // 역시 보안을 고려하여 recursive 모드 금지
    version "No!!";
};

(중략)

// 아래의 zone 설정을 추가
zone "gypark.pe.kr" IN {
    type master;
    file "zone-gypark.pe.kr";    // 이 화일을 /var/named 에 추가해주어야 함
    notify no;
    allow-query { any; };        // 이 도메인에 대한 질의에만 응답한다.
    allow-update { none; };
    allow-transfer { none; };
};

(이하 생략)

[edit]3.2. /var/named/zone-gypark.pe.kr 추가

$TTL  3600
@   IN    SOA    ns.gypark.pe.kr.     gypark.HHHHHH.snu.ac.kr.    (
    2002091501         ; Serial
    84600              ; Refresh
    1800               ; Retry
    1209600            ; Expire
    3600  )            ; Minimum

    IN    NS     ns.gypark.pe.kr.

ns                   IN    A    147.46.15.NNN   ; ns.gypark.pe.kr 은 NNNNNN
gypark.pe.kr.        IN    A    147.46.15.HHH   ; gypark.pe.kr 은 HHHHHH
www.gypark.pe.kr.    IN    A    147.46.15.HHH   ; www.gypark.pe.kr 도 HHHHHH 의 IP 를 사용

[edit]3.3. 네임서버 구동

/etc/init.d/named start

부팅시 자동으로 구동되도록 하기 위해 /etc/rc.local 화일에 다음의 항목을 추가하였다.

/etc/init.d/named start &

[edit]4. 네임서버 동작 확인

nslookup 을 사용하여 네임서버의 동작을 확인한다. 다음의 과정을 통해서 새로 설치한 네임서버가 제대로 동작하는 것을 알 수 있다.
raymundo@raymundus:~$ nslookup
Note:  nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead.  Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
> server 147.46.15.NNN               (NNNNNN 을 네임서버로 지정)
Default server: 147.46.15.NNN
Address: 147.46.15.NNN#53
> ns.gypark.pe.kr
Server:         147.46.15.NNN
Address:        147.46.15.NNN#53

Name:   ns.gypark.pe.kr
Address: 147.46.15.NNN               (ns.gypark.pe.kr 질의 - 성공)
> gypark.pe.kr
Server:         147.46.15.NNN
Address:        147.46.15.NNN#53

Name:   gypark.pe.kr
Address: 147.46.15.HHH               (gypark.pe.kr 질의 - 성공)
> www.gypark.pe.kr
Server:         147.46.15.NNN
Address:        147.46.15.NNN#53

Name:   www.gypark.pe.kr
Address: 147.46.15.HHH               (www.gypark.pe.kr 질의 - 성공)
> plaza1.snu.ac.kr
Server:         147.46.15.NNN
Address:        147.46.15.NNN#53

** server can't find plaza1.snu.ac.kr: REFUSED    (그 외의 도메인에 대한 질의 - 설정에 의해 거부됨)

네임서버설정이 완료되면, 이 네임서버를 내가 등록한 도메인의 네임서버로 지정해 주어야 한다. /개인도메인의네임서버지정 참조





출처 : http://gypark.pe.kr/wiki/%EA%B0%9C%EC%9D%B8%EB%8F%84%EB%A9%94%EC%9D%B8%EB%A7%8C%EB%93%A4%EA%B8%B0/%EB%84%A4%EC%9E%84%EC%84%9C%EB%B2%84%EC%84%A4%EC%A0%95

:

우분투 복구 모드 사용하기

보안/서버관리 | 2011. 12. 5. 20:06 | Posted by youGom

----- ---------------------------------------------------------------------

부팅시 Shift 누르기.

Advanced로 선택한 뒤, 복구모드로 부팅.

패스워드 변경전에 " mount -rw -o remount / " 를 해준 다음

" passwd userid " 로 변경해준다. 

마운트 재설정하지 않으면, 패스워드 변경이 실패한다.

--------------------------------------------------------------------------



이 글은 『Exploring Ubuntu Recovery Mode 』을 번역한 글입니다.


오늘 버추얼박스에 우분투 9.04를 새로 설치했다. 그리고 sudoers 와 sudo 명령어들을 테스트해보려고 /etc/sudoers 를 편집한 뒤 재로그인을 했더니, /etc/sudoers 에서 파서 에러가 나면서 접근이 불가능했다. 이런! 이 문제를 해결하려면 sudo 권한이 필요한데, 에러 때문에 sudo 를 쓸 수 없게 된 것이다.

문득 복구 모드가 있다는 것이 생각나서 재부팅 후 ESC 키를 눌러 표준 그럽 화면(아래 화면)으로 들어갔다.
 

사용자 삽입 이미지


위 화면에서 복구 모드(recovery mode)를 선택하면 아래와 같은 복구 모드 화면이 나타난다.

사용자 삽입 이미지 사용자 삽입 이미지

나의 경우 루트 쉘(root shell)을 선택했다. 이를 선택하면 비밀번호 없이 루트 계정에 접근할 수가 있다. /etc/sudoers 를 수정하고 재부팅을 하니 문제 해결.


우분투 9.04 의 복구 모드에서는 다음과 같은 기능을 제공한다.
  1. resume - Resume normal boot : 기본 부팅 모드로 부팅을 한다.
  2. clean - Try to make free space : 디스크 여유 공간이 부족하여 시스템이 마비되었을때 유용하다.
  3. dpkg - Repair broken packages : 망가진 패키지를 복구할 수 있다. 패키지 설치 후 시스템에 문제가 생긴 경우 유용하다.
  4. fsck - File system check : 파일 시스템 오류를 수정할 수 있다.
  5. grub - Update grub bootloader : 그럽 부트 로더 업데이트
  6. netboot - Drop to root shell prompt with networking : TCP/IP 네트워크 설정을 이용하여 부팅. 루트쉘로 로그인된다. 네트워크 관련 문제 해결에 유용하다.
  7. root - Drop to root shell prompt : 기존 루트 쉘. 설정 파일 편집을 하는데 적합하다.
  8. xfix - Try to auto repair graphic problems : X 윈도 시스템을 재설정한다.



출처 : http://openlamp.co.kr/162


:
프로젝트 산출물 관리를 위해 Trac과 svn을 연동하는 작업을 하였다. 처음엔 redhat에 깔았다가, selinux 패키지 문제 등 찾아내지 못한 문제들이 많아 ubuntu로 작업하였고, 한번 깐 다음에 문서를 작성하고, 그 대로 다시 한번 설치하여 보았다. 

이미 많은 trac, svn 연동 글들이 있지만, 해가 지나기도 하고, trac버전이 0.12로 올라오면서 trac에서 svn 지정하는 방식도 달라졌기 때문에 바로 적용하기 힘든 부분이 많았다. 이 글이 최신 버전으로 trac을 설치하는 데 도움이 되길 바란다.





1. Ubuntu 설치 

2. 파이썬 설치
#apt-get install python

3. SVN 패키지 설치
#apt-get install subversion

4. SVN 저장소 생성
#svnadmin create --fs-type fsfs <REPO-DIR>

- 사용자 추가
#htpasswd -c user_passwd admin
패스워드 입력
admin유저에 대한 정보가 user_passwd라는 파일에 기록된다.
나중에 아파치에서 이 파일을 통해 사용자 인증을 한다.

5. Apache 설치 & 실행
#apt-get install apache2 libapache2-svn
#/etc/init.d/apache2 start
웹브라우저에서 ip를 입력하여 초기 페이지가 뜨는지 확인

- Apache Python 모듈 설치
# apt-get install libapache2-mod-python

6. Apache 설정
# vi /etc/apache2/httpd.conf
dav, dav_svn 모듈이 설정되어 있는지 확인 합니다. 
주석처리 되어 있으면 주석을 없애고 없다면 아래 두줄을 추가합니다.

LoadModule dav_module         modules/mod_dav.so
LoadModule dav_svn_module     modules/mod_dav_svn.so

맨 밑에
웹으로 접근할 svn 주소를 명시한다

<Location /svn/REPO-NAME>     // 웹브라우저를 통해 ip/svn/REPO-NAME으로 접근 가능
     DAV svn
     SVNPath <REPO-DIR>     //저장소 주소     
     AuthType Basic
     AuthName "This is your repository"
     AuthUserFile /etc/apache2/pass/user_passwd //위에서 만든 패스워드 파일
     Require valid-user
</Location>

아파치 재시작
#/etc/init.d/apache2 stop
#/etc/init.d/apache2 start

이제 위의 주소를 통해 svn을 사용할 수 있다.

7. Trac 설치

- Trac 설치 필요패키지
Python
setuptools - # apt-get install python-setuptools
genshi - # apt-get install python-genshi
sqlite - # apt-get install python-sqlite

- Trac 설치

Using easy_install

One way to install Trac is using  setuptools. With setuptools you can install Trac from the subversion repository;

A few examples:

  • first install of the latest stable version Trac 0.12.2, with i18n support:
    easy_install Babel==0.9.5
    
    easy_install Trac
    
    It's very important to run the two easy_install commands separately, otherwise the message catalogs won't be generated.
  • Trac에서 Genshi 버전에러가 난다면 easy_install Genshi 로 재설치 해보자
  • upgrade to the latest stable version of Trac:
    easy_install -U Trac
    
  • upgrade to the latest trunk development version (0.13dev):
    easy_install -U Trac==dev
    

For upgrades, reading the TracUpgrade page is mandatory, of course.

8. Trac 환경 설정
1. 프로젝트 생성
# trac-admin /path/to/project initenv (생성 명령어, /path/to/project에 생성한다)
프로젝트 이름과 DB설정을 물어보는데, DB설정의 경우 아무 입력없이 enter를 치면 기본 설정으로 생성이 된다.

2. 웹에서 write 할 수 있도록 프로젝트 폴더의 권한 설정
# chown www-data:www-data -R /path/to/project

관리자 권한 부여
# trac-admin /YOUR/PROJECT/Trac_DIRECTORY/PROJECT_NAME permission add USERID TRAC_ADMIN

3. 웹 주소 매핑
- apache 설정 파일 수정
# vi /etc/apache2/httpd.conf
맨 밑에 로케이션 추가

  <Location /storagetf>     // ip/storagetf 로 접속됨
    SetHandler mod_python
    SetEnv PYTHON_EGG_CACHE /home/repo/storagetf/cache     
    PythonHandler trac.web.modpython_frontend
    PythonOption TracEnvParentDir   /home/storagetf/
    PythonOption TracUriRoot /storagetf
     AuthType Basic
     AuthName "This is your repository"
     AuthUserFile /etc/apache2/pass/user_passwd     // svn과 동일한 패스워드 파일 사용
     Require valid-userR
  </Location>

4. 웹 접속 권한 설정
# chown www-data:www-data -R /YOUR/PROJECT/Trac_DIRECTORY/
웹브라우저로 접속해보자


라고 나오면 성공, 프로젝트를 클릭하면



이런식으로 나오면 된다.


4. 웹 로그인 설정
일단 htpasswd 파일을 통한 인증을 하였는데, 관리자 id로 로그인했으면, html폼으로 로그인을 할 수 있도록 설정을 바꾸자
이를 위해 trac account manager plugin 을 깔아야 한다. http://trac-hacks.org/wiki/AccountManagerPlugin 참고
이를 깔고 아파치 재시작
관리자 메뉴에 들어가서 플러그인 목록을 보면 

이런 것들이 보일 것이다.

여기서 다 선택해도 상관이 없으며, email 인증을 하지 않을 거라면 밑에 EmailVerificationModule 은 비활성화 한다.

이를 적용한뒤, Accounts메뉴에 설정을 들어가자
사용자 id/pw를 관리할 방법, 파일 경로를 적는 것이 있는데,
htpasswd를 사용하므로

trac디렉토리/conf/trac.ini에서
password_file = 패스워드 파일 위치 추가


후에 svn도 연동하므로 svnservepasswordstore에도 추가해준다.


적용하면, Accounts->Users에서 유저 리스트 조회, 유저 추가, 패스워드 수정 등이 가능할 것이다.

웹에서 로그인도 가능

trac디렉토리/conf/trac.ini에서

[components]
trac.web.auth.loginmodule = disabled
추가

아파치 재시작




svn 저장소에 trunk, tags, branches 디렉토리를 생성한다. -> 그래야 trac이 인식함

다음 패키지를 설치한다.
apt-get install python-subversion

trac.ini에 다음을 추가한다. 
[repositories]
.alias = project
project.description = This is the ''main'' project repository.
project.dir = /home/repo/project
project.type = svn
project.url = http://your_project

svn 저장소의 hooks 디렉토리의 post-commit, post-revprop-change 실행파일을 생성(실행권한을 주어야 함)한다.
이는 commit후에 trac에 revision을 전송함으로써 trac에서 svn의 최신상태를 유지시켜준다.
post-commit

REPOS="$1"

REV="$2"


#"$REPOS"/hooks/mailer.py commit "$REPOS" $REV "$REPOS"/mailer.conf

export PYTHON_EGG_CACHE="/home/repo/cloud/cache"

/usr/local/bin/trac-admin /YOUR/TRAC/DIR changeset added "$REPOS" "$REV"


post-revprop-change

REPOS="$1"

REV="$2"

USER="$3"

PROPNAME="$4"

ACTION="$5"


#"$REPOS"/hooks/mailer.py propchange2 "$REPOS" $REV \

#  "$USER" "$PROPNAME" "$ACTION" "$REPOS"/hooks/mailer.conf

export PYTHON_EGG_CACHE="/home/repo/cloud/cache"

/usr/local/bin/trac-admin /YOUR/TRAC/DIR changeset modified "$REPOS" "$REV"

PYTHON_EGG_CACHE는 설정되어 있는 경우 해당 디렉토리를 써준다.

아파치 재시작
메뉴에서 '소스 둘러보기'가 활성화 됨



10. SSL 적용하기
을 참고하여 https 프로토콜로 전송하자
:

Vi/Vim 단축키 모음

보안/서버관리 | 2011. 11. 9. 13:37 | Posted by youGom

http://www.viemu.com/ 에서 제공하는 vi/vim 단축키 모음(Graphical vi-vim Cheat Sheet and Tutorial)을 한글로 번역하였습니다.

제가 정리하긴 했지만, 실제 번역은 우분투 한국어 커뮤니티 분들이 해주셨습니다.
제 스스로가 vi/vim 을 잘 알지 못해 잘못된 부분이 꽤 있으리라 생각됩니다. 알려주시면 감사하겠습니다. 물론 직접 수정하셔도 됩니다. SVG 파일을 첨부합니다. Inkscape 를 이용해 작업하였고, 글꼴은 은그래픽을 사용하였습니다.


:

Subversion, Trac, SSL 함께 설치하기.

보안/서버관리 | 2011. 11. 9. 13:07 | Posted by youGom

개요
- 이 문서는 우분투 리눅스 6.06 버전을 기준으로 작성되었다. (http://www.ubuntu.com
- Subversion은 CVS를 대체하기 위해서 새로 나온 버전관리시스템이다.
- Trac은 위키, 로드맵, 버그추적기능을 통합적으로 제공하며, Subversion와 강력하게 연계되어 있다.
- 이 문서 내용대로 따라하면 Subversion, Trac이 모두 다수의 프로젝트를 지원하고,
사용자 인증을 거치며, SSL암호화를 통해 모든 전송내용이 암호화되므로 대규모 운용에도 손색이 없다.

테스트 환경
- Ubuntu 6.06 LTS

보장은 못 하지만 이 문서의 내용은 다른 버전의 우분투 혹은 데비안에서도 
문제 없이 작동할 것으로 예상된다.

참고한 자료들.
Subversion 관련
https://help.ubuntu.com/6.06/ubuntu/serverguide/C/version-control-system...
http://svnbook.red-bean.com/

Trac 관련
http://trac.edgewall.org/wiki/TracUbuntuMultipleProjects
http://trac.edgewall.org/wiki/TracModPython
http://trac.edgewall.org/wiki/TracOnUbuntu

Apache SSL/TLS 암호화
http://httpd.apache.org/docs/2.0/ssl/ssl_intro.html
http://mario.espaciolinux.com/apache2_ssl.html
http://www.vanemery.com/Linux/Apache/apache-SSL.html
http://httpd.apache.org/docs/2.0/ssl/ssl_howto.html
http://httpd.apache.org/docs/2.0/mod/mod_ssl.html

이 글을 거의 다 작성하고 나서야 발견한 좋은 글 (SSL암호화를 제외한 모든 내용이 들어 있다.)
http://ariejan.net/2006/12/01/how-to-setup-a-ubuntu-development-server-p...
http://ariejan.net/2006/12/02/how-to-setup-a-ubuntu-development-server-p...

1. 필요한 패키지 설치

Subversion 설치
shell> sudo apt-get install subversion libapache2-svn

Trac 설치
shell> sudo apt-get install trac libapache2-mod-python

2. 디렉토리 구조 설명

이 문서에서 사용할 디렉토리 구조를 설명한다.
이 문서의 끝까지 계속해서 사용될 것이므로 잘 기억해 주시길..

Subversion 저장소의 뿌리
/var/lib/svn

Trac 환경의 뿌리
/var/lib/trac

test1 이라는 이름의 프로젝트가 사용하는 디렉토리
Subversion저장소 : /var/lib/svn/test1
Trac 환경 : /var/lib/trac/test1

Cool_Project 라는 이름의 프로젝트가 사용하는 디렉토리
Subversion저장소 : /var/lib/svn/Cool_Project
Trac 환경 : /var/lib/trac/Cool_Project

<프로젝트이름> 라는 이름의 프로젝트가 사용하는 디렉토리
Subversion저장소 : /var/lib/svn/<프로젝트 이름>
Trac 환경 : /var/lib/trac/<프로젝트 이름>

이해가 가시죠??

3. 뿌리 디렉토리 생성
shell> sudo mkdir /var/lib/svn
shell> sudo chown -R www-data:www-data /var/lib/svn

shell> sudo mkdir /var/lib/trac
shell> sudo chown -R www-data:www-data /var/lib/trac

4. SSL암호화에 사용할 서버인증서 생성하기
불특정 다수를 대상으로 SSL서버를 구축할 경우 
공인인증기관이 서명한 서버인증서를 구입하는 것이 좋다.
공인인증기관이 서명한 서버인증서 구입하는 방법은 
http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html 의
How do I create a real SSL Certificate? 부분을 참고하면 된다.

이 문서에서는 자기 스스로 서명한 서버인증서 기준으로 진행한다.
자기 스스로 서명한 서버인증서의 사용상 불편한 점은 
처음 접속할 때 인증서의 사용을 허가하겠다고 
'클릭을 1번 해줘야 한다'는 것이다.

자세한 내용은 다음과 같다.

OpenSSL 설치하기 (대부분의 경우 이미 설치되어 있음)
shell> apt-get install openssl

비밀키파일과 인증서 생성하기
shell> cd ~
shell> openssl req -new -x509 -nodes -out server.crt -keyout server.key
----------------------- 실행화면 시작 ------------------------------
Generating a 1024 bit RSA private key
.......................++++++
....++++++
writing new private key to 'server.key'
-----
...생략...
-----
Country Name (2 letter code) [GB]:KR
(국가코드를 입력한다.)
State or Province Name (full name) [Some-State]:
(주 혹은 도 이름을 입력한다. 
글쓴이는 직할시에 거주하므로 엔터키를 눌러서 넘어갔다.)
Locality Name (eg, city) []:Pusan
(거주하는 도시이름을 입력한다. 서울에 거주한다면 Seoul을 입력하면 될 듯하다.)
Organization Name (eg, company) [Internet Widgits Pty Ltd]:MyCompany
(조직명(혹은 회사명)을 입력한다.)
Organizational Unit Name (eg, section) []:Development
(부서이름을 입력한다.)
Common Name (eg, YOUR name) []:www.hostname.com
(Common Name은 인증서 생성시 입력하는 정보 중에서 가장 중요한 항목이다.
Common Name을 직역하면 '공통이름'이 되며, 
메세지에서는 예제로 실제 이름을 입력하라고 하지만,
그것은 개인 인증서 생성할 때나 해당되는 이야기이며, 
지금처럼 서버 인증서를 생성할 때에는 '서버 완전한 도메인 이름'을 입력해야 한다.
이 항목을 잘못 입력하면 사용자는 인증서에 심각한 에러가 있다는 메세지를 받게 되고, 
대개의 경우 에러메세지에 겁 먹고 인증서를 거부하게 되므로,
Subversion 및 Trac서비스를 제공할 수 없게 된다.
웹서버에 접속할 때 주소창에 http://www.hostname.com 이라고 입력한다면,
Common Name은 www.hostname.com 이 된다.)
Email Address []:xxx@daum.net
(전자우편주소를 입력한다. 글쓴이는 다음메일을 쓴다.)
----------------------- 실행화면 끝 ------------------------------

생성된 인증서 확인하기
shell> ls server*
server.key, server.crt 파일이 생성된 것을 알 수 있다.
server.key -> 비밀키(private key) 파일
server.crt -> 인증서(public key를 포함) 파일

인증서 파일을 적절한 위치로 복사
shell> cp server.key /etc/apache2/ssl/
shell> cp server.crt /etc/apache2/ssl/
shell> chmod 600 /etc/apache2/ssl/server.key
shell> rm ./server.key
shell> rm ./server.crt

5. Apache 웹서버 설정변경
SSL암호화를 지원하기 위해서 mod_ssl 모듈을 활성화 시킨다.
shell> sudo ln -s /etc/apache2/mods-available/ssl.load /etc/apache2/mods-enabled/
shell> sudo ln -s /etc/apache2/mods-available/ssl.conf /etc/apache2/mods-enabled/

Apache서버가 https의 기본포트인 443번을 듣도록 한다.
shell> sudo vi /etc/apache2/ports.conf
-------- /etc/apache2/ports.conf 에 추가할 내용 시작 ---------
Listen 443
-------- /etc/apache2/ports.conf 에 추가할 내용 끝 ---------

https서비스를 제공하는 VirtualHost가 사용할 DocumentRoot를 생성한다.
생성한 후에 빈 디렉토리로 놔둬도 된다.
shell> sudo mkdir /var/www-ssl

VirtualHost를 이용해서 https를 설정한다.
shell> sudo vi /etc/apache2/sites-available/ssl

--------- /etc/apache2/sites-available/ssl 내용 시작 --------------
# KLDP게시판에 업로드하면 아파치 설정화일의 태그가 사라지기 때문에
# <> 표시를 ()로 대체했습니다.
# 실제 사용할 때는 <> 로 대체해서 사용하십시오.
# 무슨 의미인지 명확하지 않다면, 
# 이 문서에 텍스트 화일로 첨부한 ssl.txt를 보십시오.
 
NameVirtualHost *:443
(VirtualHost *:443)
  DocumentRoot /var/www-ssl
 
  SSLEngine On
  SSLProtocol -all +TLSv1 +SSLv3
  SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM
  SSLOptions +StrictRequire
  SSLVerifyClient none
  SSLCertificateFile    /etc/apache2/ssl/server.crt
  SSLCertificateKeyFile /etc/apache2/ssl/server.key
 
  (Location /svn)    # Subversion 설정
    DAV svn
 
    # any "/svn/foo" URL will map to a repository /var/lib/svn/foo
    SVNParentPath /var/lib/svn
 
    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /etc/dev_passwd
    Require valid-user
  (/Location)
 
  (Location /projects) # Trac 설정
    SetHandler mod_python   
    PythonHandler trac.web.modpython_frontend   
    PythonOption TracEnvParentDir /var/lib/trac   
    PythonOption TracUriRoot /projects
 
    AuthType Basic
    AuthName "Trac, Issue Tracking and Documenting"
    AuthUserFile /etc/dev_passwd
    Require valid-user
  (/Location)
(/VirtualHost)
--------- /etc/apache2/sites-available/ssl 내용 끝   --------------

shell> sudo ln -s /etc/apache2/sites-available/ssl /etc/apache2/sites-enabled/
shell> sudo /etc/init.d/apache2 restart

VirtualHost를 이용해서 http, https를 동시에 지원하며, 
Subversion과 Trac의 모든 전송내용이 암호화되며, 
하나의 사용자인증화일을 공유한다.

6. 사용자 생성
사용자를 생성하고, 암호를 저장하는 데 htpasswd라는 프로그램을 사용한다.

htpasswd에서 자주 사용하는 옵션은 다음과 같다.
-c : 파일 생성하기. 처음 실행할 때 1번만 주면 된다.
-m : MD5 암호화하기.

예를 들어서, user1, user2, user3 에 대해서 
Subversion 및 Trac 공용 사용자 계정을 생성할려면 다음과 같이 한다.
shell> sudo htpasswd -cm /etc/dev_passwd user1
shell> sudo htpasswd -m /etc/dev_passwd user2
shell> sudo htpasswd -m /etc/dev_passwd user3

암호를 물어올 때 2번 입력해 주면 된다.
New password: ***** (암호 입력)
Re-type new password: ***** (암호 다시 입력)
Adding password for user user1

7. Ubuntu서버에 저장소(repository) 생성

Subversion 저장소를 생성한다.
shell> sudo svnadmin create /var/lib/svn/<프로젝트 이름>

Trac은 특정한 구조를 가진 Subversion저장소만 인식할 수 있다.
shell> sudo svn mkdir file://localhost/var/lib/svn/<프로젝트 이름>/branches -m "initial structure1"
shell> sudo svn mkdir file://localhost/var/lib/svn/<프로젝트 이름>/tags -m "initial structure2"
shell> sudo svn mkdir file://localhost/var/lib/svn/<프로젝트 이름>/trunk -m "initial structure3"

Apache웹서버를 재시작 한다.
shell> sudo /etc/init.d/apache2 restart

웹브라우저로 https://<서버주소>/svn/<프로젝트 이름> 에 접속해 본다.
웹브라우저에서 프로젝트 소스가 보여야 정상이다.
(서버주소에 localhost나 127.0.0.1을 입력하면 연결이 안 될 수도 있다.
ifconfig을 실행시키면 나오는 진짜 IP주소를 사용해야 한다.
응답이 없으면, iptable방화벽에서 443번 포트를 막고 있는 지 확인한다.
https://<서버주소>/svn 으로 접속하면 Forbidden에러가 난다. 
URL 마지막에 반드시 <프로젝트 이름>을 붙여야 한다.
접속과정에서 인증서 관련해서 팝업창이 뜨면 영구히 허가한다.
인증서 생성과정에서 서버이름을 잘못 입력한 경우 
에러메세지가 1번 더 뜨는 데, 무시하면 된다.)

8. Trac 환경 생성 및 초기화

Trac 환경 생성하기 전에 다음 2가지 명령을 실행한다.
shell> sudo chown -R www-data:www-data /usr/share/trac
shell> sudo chown -R www-data:www-data /var/lib/svn
shell> sudo /etc/init.d/apache2 restart

Trac 환경 생성 한다.
shell> sudo trac-admin /var/lib/trac/<프로젝트 이름> initenv
-------------------- 실행화면 시작 ----------------------------------
Creating a new Trac environment at /var/lib/trac/<프로젝트 이름>
(/var/lib/trac/<프로젝트 이름> 디렉토리에 새로운 Trac환경을 생성중임.)

Trac will first ask a few questions about your environment
in order to initalize and prepare the project database.
(Trac은 프로젝트 데이터베이스를 준비하고 초기화시키기 위해서,
당신의 환경에 대해서 몇 가지 질문을 할 것입니다.)

Please enter the name of your project.
This name will be used in page titles and descriptions.
(당신의 프로젝트의 이름을 입력하십시오.
이 이름은 페이지 제목과 비고에 사용될 것입니다.)

Project Name [My Project]> test
(프로젝트 이름. 아무 값도 입력하지 않고 엔터키를 누를 경우 기본값은 My Project임.
여기서 원하는 프로젝트 이름을 입력하고 엔터키를 누른다.)

Please specify the connection string for the database to use.
By default, a local SQLite database is created in the environment
directory. It is also possible to use an already existing
PostgreSQL database (check the Trac documentation for the exact
connection string syntax).
(데이터베이스 연결문자열을 지정해 주십시오.
기본값으로 로컬에 SQLite 데이터베이스가 생성됩니다.
이미 존재하는 Postgresql 데이터베이스를 사용할 수도 있습니다.
(정확한 연결문자열 구성은 Trac문서를 참조하십시오.)
)

Database connection string [sqlite:db/trac.db]> 
(데이터베이스 연결 문자열. 기본값은 'sqlite:db/trac.db' 임
데이터베이스 연결 문자열에 대해서 아는 바 없으므로 엔터키를 눌러서 기본값을 사용함.)

Please specify the absolute path to the project Subversion repository.
Repository must be local, and trac-admin requires read+write
permission to initialize the Trac database.
(프로젝트의 Subversion저장소가 위치한 절대경로를 지정해 주십시오.
그 저장소는 로컬에 위치해야 하고, trac-admin은 Trac 데이터베이스를 위해서
읽기, 쓰기 권한을 가지고 있어야 합니다.)

Path to repository [/var/svn/test]> /var/lib/svn/test
(저장소의 path. 기본값은 '/var/svn/test'
우리는 프로젝트 저장소를 /var/lib/svn/test에 생성해 두었으므로 그것을 입력한다.)

Please enter location of Trac page templates.
Default is the location of the site-wide templates installed with Trac.
(Trac 페이지 템플릿의 위치를 입력하십시오.
기본값은 Trac과 함께 설치된 템플릿의 위치입니다.)

Templates directory [/usr/share/trac/templates]>
(템플릿 디렉토리. 기본값은 '/usr/share/trac/templates'.
이에 대해 아는 바 없으므로 엔터키를 눌러서 기본값을 사용한다.

Creating and Initializing Project
Configuring Project
trac.repository_dir
trac.database
trac.templates_dir
project.name
Installing default wiki pages
/usr/share/trac/wiki-default/TracTicketsCustomFields => TracTicketsCustomFields
... 생략 ...
/usr/share/trac/wiki-default/WikiNewPage => WikiNewPage
Indexing repository

Project environment for 'test' created.
(test 프로젝트를 위한 환경이 생성되었습니다.)

You may now configure the environment by editing the file:
(당신은 다음 위치의 파일을 편집해서 환경설정을 바꿀 수 있습니다.)

/var/lib/trac/test/conf/trac.ini

... 생략 ...

Congratulations!
(축하합니다!)
-------------------- 실행화면 끝 ----------------------------------

Apache웹서버에게 읽기, 쓰기 권한을 준다.
shell> sudo chown -R www-data:www-data /var/lib/trac

Apache 웹서버를 재시작해야 새로운 설정화일이 반영된다.
shell> sudo /etc/init.d/apache2 restart

웹브라우저로 https://<서버주소>/projects 에 접속해 본다.
프로젝트 리스트가 보여야 정상이다.
개별 프로젝트로 들어가면 Trac이 설정해 놓은 페이지가 보인다.
(서버주소에 localhost나 127.0.0.1을 입력하면 연결이 안 될 수도 있다.
ifconfig을 실행시키면 나오는 진짜 IP주소를 사용해야 한다.
응답이 없으면, iptable방화벽에서 443번 포트를 막고 있는 지 확인한다.)

이로서 전송내용이 암호화되고 사용자인증을 거치는 Subversion, Trac의 설치를 마쳤다.
이제 사용법만 공부하면 된다. --;


출처 : http://kldp.org/node/84957
 

 

:

Ubuntu에 Subversion Server 설치하기

보안/서버관리 | 2011. 11. 9. 11:25 | Posted by youGom
Ubuntu에서 서브버전을 설치한 김에 맨날 설치하는 것도 아니기 때문에 기록차 남겨둡니다.(외워지지도 않고 매번 찾기도 귀찮아서)

SVN 설치
sudo apt-get install subversion libapache2-svn
우분투에는 apt-get이 있어서 참 변하죠. libapache2-svn은 아파치 연동을 위해서 사용하는데 저는 굳이 http://로 저장소 연결할 필요도 없는데다가 svn프로토콜이 더 빠르기도 해서 그냥 svn만 가지고 사용하기로 했습니다.


Repository 만들기
svnadmin create /home/repos/svn/project
svnadmin 명령어를 통해서 저장소를 생성합니다. 저같은 경우는 /home/repos/svn/ 아래에 저장소를 project라는 저장소를 생성합니다. 


설정파일 편집
저장소의 conf폴더 안에 있는 파일을 이용해서 권한등의 설정을 해주어야 합니다.
svnserve.conf
anon-access : 로그인하지 않은 사용자에 대한 권한입니다. none은 읽기/쓰기 금지이고 read는 읽기만 write는 쓰기만 가능합니다.
auth-access : 로그인 사용자의 권한입니다. 권한명령어는 동일합니다.
password-db = passwd : 패스워드 설정파일의 파일명입니다. 기본으로 passwd로 되어 있고 conf폴더안에 있습니다.
realm = project : 사용자가 접속시 표시되는 이름입니다. 프로젝트 명을 적어주면 됩니다.

authz
[/]
outsider = rw
모든 경로에 대해서 outsider라는 사용자에게 rw권한을 줍니다. group이나 세부경로별로도 설정할 수 있습니다.

passwd
[users]
outsider = password
사용자ID와 비밀번호를 설정해 줍니다.


SVN 서버 실행
svnserve -d -r /home/repos/svn/
svnserve 명령어를 통해서 SVN서버를 실행해 줍니다. 접근할때는 svn://프로토콜로 접속하고 URL뒤에 각 레파지토리명까지 적어주어서 접근합니다.

killall svnserve
위 명령어를 통해서 SVN서버를 종료할 수 있습니다.



출처 : http://blog.outsider.ne.kr/472 
:

1. IP 설정을 한 후 Ping을 날려본다.
 - ping 외부 사이트 
 - ping 게이트 웨이
 - ping 같은 게이트 웨이의 다른 IP
2.  nslookup kpeople.co.kr
 - 이 사이트는 예외가 없이도 쿼리를 주고 받을 수 있는 사이트
 - 만약에 접근이 안된다면, 네트워크 설정이 잘못된 것
3.  프록시가 필요하다면 FireFox와 System Network Proxy에 등록
 - 프록시가 항상 등록 될 수 있게 /Home 아래에 있는
 - .bashrc 하고  .profile에 
 - export http_proxy=0.0.0.0:8080 이라고 적는다.
4. 파폭으로 www.daum.net 또는 www.naver.com등을 입력해 인터넷이 잘 연결됨을 확인
5. 인터넷 연결 완료 후 업데이트 후 SSH를 설치한다.
 - 업데이트 :  sudo apt-get update  (  repository 정보만 업데인트 )
 - SSH 설치 : sudo apt-get install openssh-server
 
설치 후에 컴퓨터를 끄고, 적절한 위치에 두고. 전원만 연결해 두면 된다.
컴퓨터 전원 관련 명령어가 shutdown인줄알았다. 아니였다.
아래와 같이 컴퓨터를 끌 때와 재부팅 명령어를 사용하면 된다. 
* 종료 : sudo halt
* 재부팅 : sudo reboot
 
: