○ 아스키 파일 암호화 하기

아스키 파일은 쉽게 암호화및 복호화될 수 있다.

암호화하기 위해서는 간단히 파일의 표준출력을 파이프를 이용해 "crypt" 명령의 입력으로 넘겨주고
새 파일명으로 redirect 시키면 된다. "Enter key:" 라는 프롬프트가 나오면 패스워드를 입력한다.

$ cat foo | crypt > foo.e
Enter key:

복호화하기 위해서는 간단히 암호화된 파일의 표준출력을 파이프를 이용해 "crypt" 명령의 입력으로
넘겨주고 새 파일명으로 redirect 시키면 된다. "Enter key:"라는 프롬프트가 나오면 패스워드를 입력한다.

$ cat foo.e | crypt > foo.new
Enter key:

=========== 원문 ===========
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 3144 - September 14, 2008

                   http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

CRYPT AN ASCII FILE

An ascii file can be easily encrypted and
decrypted.

To encrypt simply pipe the STDOUT of
the file to "crypt" and redirect it to
a new file name. Enter a passowrd when
prompted with "Enter key".

$ cat foo | crypt > foo.e
Enter key:

To unencrypt simply pipe the STDOUT of
the encrypted file to "crpyt" and
redirect it to a new file name. Enter
a passowrd when prompted with
"Enter key".

$ cat foo.e | crypt > foo.new
Enter key:

반응형
Posted by She쥐포s

○ ssh root 접속제한

# vi /etc/ssh/sshd_config

       # PermitRootLogin yes
       라고 되어있는 부분의 주석을 해제하고 yes를 no로 고친다
       PermitRootLogin no

# /etc/rc.d/init.d/sshd restart

○ su 명령어 제한

# vi /etc/pam.d/su 에 6번라인

        # auth required /lib/security/$ISA/pam_wheel.so use_uid
        주석 제거
        auth required /lib/security/$ISA/pam_wheel.so use_uid

# usermod -G wheel [user]
        -> wheel 그룹에 속한 사용자는 su 사용불가

○ sudo 명령어 사용

# visudo

        맨 마지막 행에
        [user] (TAB) ALL=(ALL) (TAB) ALL
        추가

참고 : http://blog.naver.com/ssalleng21?Redirect=Log&logNo=130030195364

반응형
Posted by She쥐포s
o 단순히 빈라인(※ 스페이스나 탭을 사용하지 않은 순수한 빈라인)의 수를 알아내기 위해서는
   다음의 명령을 사용하면 된다.

cat FILENAME | awk '/^$/ { ++x } END { print "No. of Blank line = " x }'
반응형
Posted by She쥐포s

2008. 5. 5. 17:37 Unix

vi로 파일 역순출력

o 일반적인 Linux System 또는 tac가 깔려있는 경우라면 손쉽게 파일내용을 역순으로 출력할 수 있다.

그러나 tac가 없는 경우 vi를 이용하여 파일의 내용을 거꾸로 바꾸는 방법을 소개한다.

vi에서 다음을 입력한다.

:g/.*/m0


반응형
Posted by She쥐포s
o vim을 hex editor로 사용하기

:%!xxd
반응형
Posted by She쥐포s

※ 본 내용은 NTP 서버 없이 1회 time sync를 할 경우에 사용하는 방법임

○ NTP 서버(2008년 4월 23일 기준)
    time.bora.net
    time.wonkwang.ac.kr

○ Time Sync
    1) Solaris
        # rdate [NTP서버]
            예) # rdate time.bora.net
    2) linux
        # rdate -s [NTP서버]
            예) # rdate -s time.bora.net
    3) windows
        i) 날짜/시간 등록정보창에서 표준시간대 선택
            - 한국이면 (GMT+09:00) 서울
        ii) cmd 창 실행
            - net time /setsntp:time.bora.net
                                       ^^^^^^^^^^^^^
                                         NTP Server

※ 참고URL
    3) : http://blog.naver.com/rdj1004?Redirect=Log&logNo=120020019727

반응형
Posted by She쥐포s
HP-UX가 현재 몇 비트로 작동하는지 알아보기 위해서

getconf KERNEL_BITS
반응형
Posted by She쥐포s
o 쉘도라도 닷 컴
    - 좋은 코딩의 예
    - 스크립트 예제
    - 쉘관련 링크
    - Tip과 Trick 등 여러가지 읽을거리가 많이 있다.

http://www.shelldorado.com
반응형
Posted by She쥐포s

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2957 - March 11, 2008

                   http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Sun 장비의 메모리 확인

Sun 장비의 RAM의 양을 빨리 확인하기 위해서는

/usr/sbin/prtconf | grep Mem

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

QUICKLY FINDING SUN MEMORY

To quickly find the amount of RAM a
Sun Machine has:

prtconf | grep Mem

반응형
Posted by She쥐포s

2008. 3. 30. 22:07 Unix

cpio로 파일옮기기

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2965 - March 19, 2008

                   http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

cpio로 파일 옮기기

한 디렉토리 또는 파일시스템에서 다른 디렉토리 또는 파일시스템으로
옮겨야 할 대량의 파일이 있을 경우 다음의 명령을 이용하라.

# find /old_directory -depth | cpio -pdmv /new_directory

이 명령은 소유자와 권한, 디렉토리 구조를 유지하면서 지정한
old_directory 밑의 모든 파일을 new_directory로 옮길 것이다.

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

MOVING FILES WITH CPIO

If you have a multitude of
files to move from one
directory or filesystem to
another, here's a one liner:

# find /old_directory -depth | cpio -pdmv /new_directory

This will move all of the
files under the specified
old_directory to the
new_directory, keeping the
same ownership, permissions,
and directory structure.

반응형
Posted by She쥐포s
이전버튼 1 2 3 4 5 이전버튼

블로그 이미지
She쥐포s
Yesterday
Today
Total

달력

 « |  » 2024.4
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

최근에 올라온 글

최근에 달린 댓글

글 보관함