Linux/Ubuntu2012. 1. 3. 19:17
댓글에 달린 번쩍이는 내용!
mount 시에 /dev/sda 가 아닌 UUID를 이용해서 마운트를 하면 드라이브 순서가 바뀌지 않는다는데!
해보니 vol_id 명령은 되지 않고, blkid를 통해서 하면 UUID를 얻을수 있다.

$ sudo blkid
/dev/sda1: TYPE="ntfs" UUID="A0F0582EF0580CC2"
/dev/sda2: UUID="8c2da865-13f4-47a2-9c92-2f31738469e8" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda3: TYPE="swap" UUID="5641913f-9bcc-4d8a-8bcb-ddfc3159e70f"
/dev/sda5: UUID="FAB008D6B0089AF1" TYPE="ntfs"
/dev/sdb1: UUID="32c61b65-f2f8-4041-a5d5-3d5ef4182723" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdb2: UUID="41c22818-fbad-4da6-8196-c816df0b7aa8" SEC_TYPE="ext2" TYPE="ext3" 

$ sudo vi /etc/fstab
UUID=41c22818-fbad-4da6-8196-c816df0b7aa8  /disk2p2      ext3    defaults,errors=rem

[링크 : http://www.cyberciti.biz/faq/linux-finding-using-uuids-to-update-fstab/]
[링크 : http://linux.die.net/man/8/mount
[링크 : http://linux.die.net/man/8/blkid

2011/03/22 - [Linux] - fstab

'Linux > Ubuntu' 카테고리의 다른 글

ubuntu 에서 mysql 기본 db 위치  (0) 2012.01.04
gpart / testdisk  (0) 2012.01.04
hylafax - 리눅스용 팩스 서버  (0) 2012.01.01
deb 파일 설치하기  (0) 2011.12.23
Ubuntu 화면 동영상 캡쳐용 프로그램  (0) 2011.12.20
Posted by 구차니
Linux/Ubuntu2012. 1. 1. 15:04
hylafax-server 패키지를 설치하면 우르르 깔리는데 postfix라는 메일관련 데몬도 같이 설치되는것 같다.
일단 설정법은 모르니 패스 

$ sudo apt-get install hylafax-server 
$ sudo faxsetup 

$ sudo fax
fax2ps       faxalter     faxdeluser   faxmodem     faxrm        faxwatch
fax2tiff     faxanswer    faxgetty     faxmsg       faxsend      
faxabort     faxconfig    faxinfo      faxq         faxsetup     
faxaddmodem  faxcover     faxlock      faxqclean    faxstat      
faxadduser   faxcron      faxmail      faxquit      faxstate 

설치하고 나니
4599 tcp 포트로 hylafax가 열리는데 웹기반으로는 아니고 멀까...

[링크 : http://dolba.net/tt/k2club/entry/Fax-receiving-server-concept]
[링크 : http://ubuntuforums.org/showthread.php?t=888080

[링크 : http://www.hylafax.org/content/Main_Page]  
    [링크 : http://www.hylafax.org/content/Web_Based_Faxing]
[링크 : http://winprinthylafax.sourceforge.net/]

+
2017.02.06


Posted by 구차니
Linux2011. 12. 25. 19:32
sudo는 일시적으로 root 권한을 받아와서 실행하는
setUID / setGUID 프로그램이고 정책(policy)의 일종이다.
즉, 이러한 권한 자체가 설정이 잘못되었을 경우 도용으로 인한 프로그램의 실행을 막을 방법은 없다는 것이다.
그런 이유로 커널수준에서 특정 권한을 막을 방법이 필요하게 되었고 이를 보완하기위해 만들어진 것이 selinux 이다.
라고는 하는데..

솔찍히 Fedora 쪽에서는 sudo의 주력 도입이 debian 보다는 늦은 편이었고
그로 인해서 초기에 sudo에 익숙해지는데 조금 불편함을 느꼈지만
반대로 Fedora에서는 초기에 selinux를 넣은데 반해 우분투에서는 기본 패키지로 추가하지 않아
Selinux를 끄거나 하는 불편함은 존재하지 않는걸 봐서는 미묘한 배포판의 컨셉의 차이라고 해야하나...



SUDO
sudo는 /etc/sudoers의 설정에 따라 움직인다.
wheel은 페도라에서 사용하는 그룹으로 우분투의 경우 admin 그룹을 지칭하고
wheel/admin은 말그대로 관리자 권한을 가지는 그룹을 의미한다. 


wheel 그룹에 대한 간단한 설명

그룹 (Wheel)

휠그룹은 무엇을 위한 것인가? 대부분 오랫동안 사용되어오면서 모호한 표현이라 생각한다. 이것은 사용자 권한을 나누기 위해 사용된다. root, 휠그룹, 그밖의 사용자로 3개의 계층으로 분류되어 있다. 

보통 휠그룹은 그에 속한 그룹 사용자들만 su root 를 사용할 수 있도록 하는 기능이다. FSF(자유소프트웨어 재단) 그룹은 이 원칙에 별로 따르지 않는데 왜냐하면 그것이 수학적 알고리즘이 아니기 때문이다. 

사용자를 최소로 구분하는 것은 sudo 에 의한다. 가장 많은 sudo 권한을 위한 자격으로 휠그룹 멤버쉽이라 불리는 것이 있다. 

역사적으로 말하면 그것은 초기 BSD중의 하나에서 시작되었다 생각한다. 

휠그룹을 만들므로써 휠의 기능을 쉽게 다시 만들 수 있으며 그리고 su 와 sudo (둘다 setuid 프로그램이다.)를 wheel 그룹으로 만들고 나서 다른 사용자에 대해서는 사용권한을 제거한다. 

  # chgrp wheel /bin/su /bin/sudo
  # chown o-rwx /bin/su /bin/sudo

물론 이것은 실제적으로 정상적인 사용자들에게 su와 sudo 를 사용할 수 없게 만든다. 문제는 서버에 어떤 정상적인 사용자들이 있는가이다. 
 
[링크 : http://zicman.egloos.com/2449683]  

sudoer 추가하기 

Fedora 
# visudo                       #  /etc/sudoers 파일이 열린다. `%wheel ALL=(ALL)` 라인 추가
# usermod -G wheel <userid>

Ubuntu 
# visudo                       #  /etc/sudoers 파일이 열린다. `%admin ALL=(ALL)` 라인 추가
# usermod -G admin <userid>
 
[링크 : http://wiki.kldp.org/wiki.php/sudo]  

The sudo philosophy
===================
Sudo is a program designed to allow a sysadmin to give limited root privileges
to users and log root activity.  The basic philosophy is to give as few
privileges as possible but still allow people to get their work done.

[링크 : http://www.sudo.ws/sudo/readme.html]  

[링크 : http://www.sudo.ws/sudo/sudoers.man.html]

SELINUX
SELinux에 대해서는 머만 하려고 하면 다 막혀서 항상 FC4 이후로는 항상 끄고 살았던 기억만.. OTL

[링크 : http://www.ibm.com/developerworks/kr/library/l-selinux/
[링크 : https://wiki.ubuntu.com/SELinux
    [링크 : http://packages.ubuntu.com/lucid/selinux-policy-ubuntu

2010/02/04 - [Linux/Ubuntu] - sudo 사용가능하도록 설정하기

'Linux' 카테고리의 다른 글

localtime() 과 mktime()을 이용하기  (0) 2012.03.27
partitionless disk  (2) 2012.01.06
조이스틱 / 조이패드 on ubuntu  (2) 2011.12.23
iptables MASQUERADE (공유기 만들기?)  (0) 2011.12.04
리눅스를 라우터로 만들기  (0) 2011.12.02
Posted by 구차니
Linux/Ubuntu2011. 12. 23. 16:54
설치
dpkg -i filename.deb

제거
dpkg -r filename.deb 

[링크 : http://linux.die.net/man/1/dpkg]
[링크: http://snowbora.com/345


의존성 확인시 
 --igrore-depends=packge 로 해키지의 의존성은 무시할 수 없지만 
추가 설치를 하지 않기 때문에 의존성은 별도로 해결해 주어야 한다.
[링크 : http://kldp.org/node/125131]

Posted by 구차니
Linux2011. 12. 23. 15:46
심심해서 조이스틱/조이패드를 둘다 리눅스에 물려보니 아래와 같은 메시지가 출력된다.
# dmesg 
[   83.940034] usb 3-1: new low speed USB device using uhci_hcd and address 2
[   84.167185] usb 3-1: configuration #1 chosen from 1 choice
[   84.277932] usbcore: registered new interface driver hiddev
[   84.303187] input: USB,2-axis 8-button gamepad   as /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/input/input9
[   84.303418] generic-usb 0003:0583:206F.0001: input,hidraw0: USB HID v1.10 Joystick [USB,2-axis 8-button gamepad  ] on usb-0000:00:1d.1-1/input0
[   84.303446] usbcore: registered new interface driver usbhid
[   84.304458] usbhid: v2.6:USB HID core driver

[   86.544033] usb 3-2: new low speed USB device using uhci_hcd and address 3
[   86.770197] usb 3-2: configuration #1 chosen from 1 choice
[   86.801540] input: 5-Axis,12-Button with POV  as /devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0/input/input10
[   86.802854] generic-usb 0003:12BD:A02F.0002: input,hidraw1: USB HID v1.10 Joystick [5-Axis,12-Button with POV ] on usb-0000:00:1d.1-2/input0 

jscalibrator는 패키지가 사라졌는지 설치가 안된다.
$ sudo apt-get install joystick
[링크 : http://ubuntuforums.org/showthread.php?t=338457
 
/dev/input에 접속한 장치의 목록이 나타난다.
cat으로 파일 내용을 보면 깨지는데 어떻게 이 녀석을 읽어서 판독하는 걸려나? 
$ ls -al /dev/input/
합계 0
drwxr-xr-x   4 root root    400 2011-12-23 15:42 ./
drwxr-xr-x  17 root root   3760 2011-12-23 15:42 ../
drwxr-xr-x   2 root root    120 2011-12-23 15:42 by-id/
drwxr-xr-x   2 root root    180 2011-12-23 15:42 by-path/
crw-r-----   1 root root 13, 64 2011-12-23 15:41 event0
crw-r-----   1 root root 13, 65 2011-12-23 15:41 event1
crw-rw----+  1 root root 13, 74 2011-12-23 15:42 event10
crw-r-----   1 root root 13, 66 2011-12-23 15:41 event2
crw-r-----   1 root root 13, 67 2011-12-23 15:41 event3
crw-r-----   1 root root 13, 68 2011-12-23 15:41 event4
crw-r-----   1 root root 13, 69 2011-12-23 15:41 event5
crw-r-----   1 root root 13, 70 2011-12-23 15:41 event6
crw-r-----   1 root root 13, 71 2011-12-23 15:41 event7
crw-r-----   1 root root 13, 72 2011-12-23 15:41 event8
crw-rw----+  1 root root 13, 73 2011-12-23 15:42 event9
crw-rw-r--+  1 root root 13,  0 2011-12-23 15:42 js0
crw-rw-r--+  1 root root 13,  1 2011-12-23 15:42 js1
crw-r-----   1 root root 13, 63 2011-12-23 15:41 mice
crw-r-----   1 root root 13, 32 2011-12-23 15:41 mouse0
crw-r-----   1 root root 13, 33 2011-12-23 15:41 mouse1 

$ tree /dev/input/
/dev/input/
|-- by-id
|   |-- usb-0583_USB_2-axis_8-button_gamepad-event-joystick -> ../event9
|   |-- usb-0583_USB_2-axis_8-button_gamepad-joystick -> ../js0
|   |-- usb-12bd_5-Axis_12-Button_with_POV-event-joystick -> ../event10
|   `-- usb-12bd_5-Axis_12-Button_with_POV-joystick -> ../js1
|-- by-path
|   |-- pci-0000:00:1d.1-usb-0:1:1.0-event-joystick -> ../event9
|   |-- pci-0000:00:1d.1-usb-0:1:1.0-joystick -> ../js0
|   |-- pci-0000:00:1d.1-usb-0:2:1.0-event-joystick -> ../event10
|   |-- pci-0000:00:1d.1-usb-0:2:1.0-joystick -> ../js1
|   |-- platform-i8042-serio-0-event-kbd -> ../event5
|   |-- platform-i8042-serio-2-event-mouse -> ../event7
|   `-- platform-i8042-serio-2-mouse -> ../mouse1
|-- event0
|-- event1
|-- event10
|-- event2
|-- event3
|-- event4
|-- event5
|-- event6
|-- event7
|-- event8
|-- event9
|-- js0
|-- js1
|-- mice
|-- mouse0
`-- mouse1 







 

'Linux' 카테고리의 다른 글

partitionless disk  (2) 2012.01.06
sudo와 selinux  (0) 2011.12.25
iptables MASQUERADE (공유기 만들기?)  (0) 2011.12.04
리눅스를 라우터로 만들기  (0) 2011.12.02
SATA 와 IDE 하드 순서 인식 뒤바뀌는 문제  (0) 2011.11.23
Posted by 구차니
Linux/Ubuntu2011. 12. 20. 22:51
Poedit TM 사용법 검색하다가 -_-
문득 동영상 촬영을 우분투에서 해서 어떤 프로그램으로 쓴걸까 호기심 발동!



대충 검색을 해보니 아래의 프로그램들이 나오는데
1. XvidCap
2. recordMyDesktop
3. RecordItNow




XvidCap은 mpeg로 바로바로 저장해서 별다른 인코딩을 하지 않는 장점이 있는 대신
창의 크기를 손쉽게 선택할 수 없고, 특정 창만 고르거나 전체창을 고르는 기능이 없는 단점이 있다. 

recordMyDesktop 인 RecordItNow의 경우 Theora 코덱으로 기본값이 되어 있는지 변환을 해야 해서 버버버버벅 하는 단점..
하지만 전체창을 녹화하기에는 편하고 기본적으로 오디오를 잘 찾는 장점이 있다.
개인적으로는 RecordItNow나 recordMyDesktop 이나 결국에는 GUI Front-end이고 Backend는 동일한 느낌이라
두개는 사실상 동일한거라고 보는게 나을 듯 하다.



결론 : 취향에 따라 다르겠지만, 녹화후 인코딩이 없는 XVidCap이 무난할듯?
Posted by 구차니
Linux/Ubuntu2011. 12. 17. 19:54
일단 비슷한 제품(?)으로는 cisco의 RV042 RV082 등이 있는데
이 제품은 2개의 WAN 포트를 제공하고 2개의 포트를 이용해 load balancing / falut tolerant 를 지원한다.
[링크 : http://www.cisco.com/web/KR/.../data_sheet_RV042_Dual_WAN_VPN_Router.pdf]
[링크 : http://www.cisco.com/web/KR/COBO/pdf/Cisco_RV082_KO.pdf]

아무튼 그림에서 느낌이 퐉! 오는데!
솔찍히 무슨 소리인지 모르겠따 -_-
                                                                 ________
                                          +------------+        /
                                          |            |       |
                            +-------------+ Provider 1 +-------
        __                  |             |            |     /
    ___/  \_         +------+-------+     +------------+    |
  _/        \__      |     if1      |                      /
 /             \     |              |                      |
| Local network -----+ Linux router |                      |     Internet
 \_           __/    |              |                      |
   \__     __/       |     if2      |                      \
      \___/          +------+-------+     +------------+    |
                            |             |            |     \
                            +-------------+ Provider 2 +-------
                                          |            |       |
                                          +------------+        \________ 

[링크 : http://tldp.org/HOWTO/Adv-Routing-HOWTO/]
    [링크 : http://tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.rpdb.multiple-links.html
    [링크 : http://www.linuxhorizon.ro/iproute2.html ] <<<
[링크 : http://www.linuxquestions.org/questions/linux-networking-3/routing-to-multiple-gateways-145635/]

nexthop NEXTHOP
the nexthop of a multipath route. NEXTHOP is a complex value with its own syntax similar to the top level argument 
lists:

weight NUMBER - is a weight for this element of a multipath route reflecting its relative bandwidth or quality.

equalize
allow packet by packet randomization on multipath routes. Without this modifier, the route will be frozen to one selected nexthop, so that load splitting will only occur on per-flow base. equalize only works if the kernel is patched. 

[링크 : http://linux.die.net/man/8/ip
 
[링크 : http://linux.die.net/man/8/iptables]
[링크 : http://linux.die.net/man/8/route]

Windows에서 여러개의 게이트웨이 설정하는 방법
[링크 : http://windows.microsoft.com/en-US/windows-vista/Configuring-multiple-gateways-on-a-network]

'Linux > Ubuntu' 카테고리의 다른 글

deb 파일 설치하기  (0) 2011.12.23
Ubuntu 화면 동영상 캡쳐용 프로그램  (0) 2011.12.20
ifenslave mode 설정하기  (0) 2011.12.15
ethtool - 리눅스에서 네트워크 링크 상태 / 속도 확인하기  (0) 2011.12.11
ubuntu motd  (0) 2011.12.11
Posted by 구차니
Linux/Ubuntu2011. 12. 15. 22:38
ifenslave를 통한 channel bonding은
modprobe 시에 mode=0 과 같은 옵션을 주어 수행한다는데..
일단 기본값으로는 0번(round robin)이 되어 있고 다음과 같이 숫자를 주어 다른 모드로 시작할 수 있다.
# modprobe bonding mode=6 
# cat /proc/net/bonding/bond0 
Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)

Bonding Mode: adaptive load balancing
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth1
MII Status: up
Link Failure Count: 1
Permanent HW addr: 00:00:00:00:00:00

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:00:00:00:00:00 

만약 작동중에 mode를 변경하고 싶다면
다음과 같이 /sys/class/net/bond0/bonding/mode 파일에 원하는 mode 값을 넣어주면 된다. 
To configure bond0 for balance-alb mode:
# ifconfig bond0 down
# echo 6 > /sys/class/net/bond0/bonding/mode
 - or -
# echo balance-alb > /sys/class/net/bond0/bonding/mode
NOTE: The bond interface must be down before the mode can be changed.

[링크 : http://www.kernel.org/doc/Documentation/networking/bonding.txt



Posted by 구차니
Linux/Ubuntu2011. 12. 11. 21:03
물론 socket을 건드려야 해서 root 권한으로 해야만 원하는 값을 얻을수 있다.
$ ethtool eth0
Settings for eth0:
Cannot get device settings: Operation not permitted
Cannot get wake-on-lan settings: Operation not permitted
        Current message level: 0x000000ff (255)
Cannot get link status: Operation not permitted



$ sudo ethtool eth0
Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Link partner advertised link modes:  Not reported
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: No
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: pg
        Wake-on: d
        Current message level: 0x000000ff (255)
        Link detected: yes 

[링크 : http://www.cyberciti.biz/faq/howto-setup-linux-lan-card-find-out-full-duplex-half-speed-or-mode/]

아래는 C 코드로 작성한 링크 속도 확인방법
[링크 : http://stackoverflow.com/questions/2872058/get-link-speed-programmatically]
Posted by 구차니
Linux/Ubuntu2011. 12. 11. 17:01
/etc/motd 를 통해 로그인 시에 메시지가 출력되는데
업데이트 하는 방법은 update-motd 라는 명령어를 이용하는데
문제는(?) 이 motd 파일이 언제 업제이트 되는지 라는 것.
아무리 뒤져봐도 영 안보이는데 어디서 어떻게 업데이트 되는거니~ -_-

$ sudo grep -rni "motd" /etc
/etc/update-motd.d/90-updates-available:3:exec /usr/lib/update-notifier/update-motd-updates-available
/etc/update-motd.d/98-reboot-required:3:exec /usr/lib/update-notifier/update-motd-reboot-required
/etc/update-motd.d/99-footer:3:# motd.tail is reserved for the admin to append static
/etc/update-motd.d/99-footer:5:# /etc/motd.
/etc/update-motd.d/99-footer:8:# script to /etc/update-motd.d/
/etc/update-motd.d/99-footer:10:[ -f /etc/motd.tail ] && cat /etc/motd.tail || true
/etc/update-motd.d/20-cpu-checker:3:exec /usr/lib/update-notifier/update-motd-cpu-checker
/etc/update-motd.d/91-release-upgrade:3:exec /usr/lib/update-manager/release-upgrade-motd
/etc/pam.d/sshd:27:session    optional     pam_motd.so # [1]
/etc/pam.d/login:72:# Prints the motd upon succesful login
/etc/pam.d/login:73:# (Replaces the `MOTD_FILE' option in login.defs)
/etc/pam.d/login:74:session    optional   pam_motd.so
/etc/login.defs:312:#MOTD_FILE
/etc/ssh/sshd_config:64:PrintMotd no
/etc/apparmor/severity.db:128:/etc/motd 1 3 0 

$ ll /etc/update-motd.d/
total 44
drwxr-xr-x   2 root root  4096 2011-12-11 15:08 ./
drwxr-xr-x 130 root root 12288 2011-12-11 16:41 ../
-rwxr-xr-x   1 root root    57 2010-04-23 18:45 00-header*
-rwxr-xr-x   1 root root   248 2010-04-23 18:45 10-help-text*
-rwxr-xr-x   1 root root    65 2010-04-14 05:45 20-cpu-checker*
lrwxrwxrwx   1 root root    46 2011-12-11 15:08 50-landscape-sysinfo -> /usr/share/landscape/landscape-sysinfo.wrapper*
-rwxr-xr-x   1 root root    71 2010-04-14 05:45 90-updates-available*
-rwxr-xr-x   1 root root    61 2010-10-13 16:40 91-release-upgrade*
-rwxr-xr-x   1 root root    69 2010-04-14 05:45 98-reboot-required*
-rwxr-xr-x   1 root root   261 2010-04-23 18:45 99-footer* 

[링크 : http://www.ubuntu.or.kr/viewtopic.php?p=1070]
[링크 : http://www.ubuntugeek.com/how-to-change-message-of-the-day-motd-in-ubuntu-server.html]
Posted by 구차니