리눅스 또는 윈도우 iso 이미지 파일로부터 부팅 가능한 USB메모리를 만드는 방법이다. 터미널창에서 명령어로 쉽게 가능하다(데비안/우분투 기준).
우선 USB메모리를 연결한 후, 장치명을 확인하자. 터미널창에서 아래와 같이 입력.
# 장치 목록 표시
lsblk
출력된 결과로부터 USB메모리에 대응하는 장치명을 파악한다. 통상 /dev/sdc, /dev/sdd 이런식이 될 것이다. 여기서는 장치명이 /dev/sdc라고 가정해 보자.
만약 해당 USB메모리가 마운트 되어 있다면 해제해야 한다. 디스크 빈 공간을 확인하기 위한 df 명령으로 간단히 확인 가능하다. 만약 마운트되어 있다면 장치명과 마운트된 디렉토리가 표시될 것이다.
# 디스크 빈 공간 확인
df
# /dev/sdc 마운트 해제
sudo umount /dev/sdc
이제 dd 명령을 이용해서 iso 이미지 파일을 옮기면 된다. 예를 들어 ubuntu.iso 파일을 /dev/sdc로 옮긴다면 아래와 같이 입력.
# ubuntu.iso 파일을 /dev/sdc 장치로 보냄
sudo dd if=ubuntu.iso of=/dev/sdc bs=4M && sync
dd
의 옵션을 보자면, if는 입력대상(읽어야 할 파일, iso 이미지), of는 출력대상(USB메모리), bs는 한번에 읽어서
처리할 용량 단위인데 iso의 블록 단위인 2048바이트의 배수로 적당히 정하면 될 듯(위의 예시에서는 4MB)
dd 명령이 종료된 후에도 USB메모리에 쓰는 작업은 아직 끝나지 않았을 수가 있다. 따라서 dd 명령이 정상적으로 종료되고 나면 sync 명령으로 메모리와 디스크를 동기화해 주면 완료.
'Linux'에 해당되는 글 23건
- 2017.05.30 producing bootable image on USB (using command 'dd')
- 2016.09.27 Creating desktop Icon in debian linux
- 2015.08.10 .vimrc 설정
- 2015.07.06 linux compression / decompression
- 2015.06.15 vim hex mode
- 2014.08.29 memory setting using malloc() and practicing coding
- 2014.08.22 iptables and setting ftp server
- 2014.08.21 firewall and regulations for control net condition
- 2014.08.21 obtaining root position using telnet service system
- 2014.08.18 link options / xinetd
[Desktop Entry]
Name=Eclipse 4
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE;
Name[en]=Eclipse
eclipse.desktop 파일 형태로 desktop 폴더에 저장후 권한 조정 후 사용 가능
xdg-open 참고
'Linux' 카테고리의 다른 글
.vimrc 설정 (0) | 2015.08.10 |
---|---|
linux compression / decompression (0) | 2015.07.06 |
vim hex mode (0) | 2015.06.15 |
memory setting using malloc() and practicing coding (0) | 2014.08.29 |
iptables and setting ftp server (0) | 2014.08.22 |
1 set tabstop=2
2 set shiftwidth=2
3 set expandtab
4 set softtabstop=2
5 set visualbell
6 set cindent
7 set autoindent
8 set smartindent
9 set enc=utf8
10 set incsearch
11 syntax on
12 filetype on
13 set background=dark
14 colorscheme evening
15 set backspace=eol,start,indent
16 set history=1000
17 set hlsearch
18 set ignorecase
19 set showmatch
20 set number
~
'Linux' 카테고리의 다른 글
Creating desktop Icon in debian linux (0) | 2016.09.27 |
---|---|
linux compression / decompression (0) | 2015.07.06 |
vim hex mode (0) | 2015.06.15 |
memory setting using malloc() and practicing coding (0) | 2014.08.29 |
iptables and setting ftp server (0) | 2014.08.22 |
.zip
압축
$ zip -r [압축파일명.zip] [압축할 파일/디렉토리]
압축 해제
$ unzip [압축파일명.zip]
.tar
압축
$ tar cf [압축파일명.tar] [압축할 파일/디렉토리]
압축 해제
$ tar xf [압축파일명.tar]
tar.gz
압축
$ tar zcf [압축파일명.tar.gz] [압축할 파일/디렉토리]
압축 해제
$ tar xfz [압축파일명.tar.gz]
.tar.bz2
압축
$ tar jcf [압축파일명.tar.bz2] [압축할 파일/디렉토리]
압축 해제
$ tar xfj [압축파일명.tar.bz2]
.tar.xz - 이중으로 압축을 풀어야 합니다.
압축 해제 (.xz 압축 해제 -> tar 압축 해제)
$ xz -d [압축파일명.tar.xz]
$ tar -xf [압축파일명.tar]
'Linux' 카테고리의 다른 글
Creating desktop Icon in debian linux (0) | 2016.09.27 |
---|---|
.vimrc 설정 (0) | 2015.08.10 |
vim hex mode (0) | 2015.06.15 |
memory setting using malloc() and practicing coding (0) | 2014.08.29 |
iptables and setting ftp server (0) | 2014.08.22 |
바이너리로 저장된 파일을 hex코드로 보는 명령이 기본적으로 vim에도 있습니다.
돌아가는 것은
:%!xxd -r
'Linux' 카테고리의 다른 글
.vimrc 설정 (0) | 2015.08.10 |
---|---|
linux compression / decompression (0) | 2015.07.06 |
memory setting using malloc() and practicing coding (0) | 2014.08.29 |
iptables and setting ftp server (0) | 2014.08.22 |
firewall and regulations for control net condition (0) | 2014.08.21 |
Q.
#include <stdio.h>
int main(){
char str[20]={0};
char *ptr=str;
printf("input str : ");
//scanf("%s", str);
gets(str);
while(*ptr){
if(*ptr>='a' && *ptr<='z'){
*ptr=*ptr-32;
}else if(*ptr >= 'A'&& *ptr <='Z'){
*ptr=*ptr+32;
}
ptr++;
}
printf("str :%s \n", str);
return 0;
}
'Linux' 카테고리의 다른 글
linux compression / decompression (0) | 2015.07.06 |
---|---|
vim hex mode (0) | 2015.06.15 |
iptables and setting ftp server (0) | 2014.08.22 |
firewall and regulations for control net condition (0) | 2014.08.21 |
obtaining root position using telnet service system (0) | 2014.08.21 |
service httpd start
/etc/sysconfig/iptables 80 open
웹서버는 처음엔 전부 닫혀있는 상태
iptables 에서 ACCEPT를 먼저 올리고 DROP을 밑으로 (white list기반)
---------------
ftp 서버 설치
방화벽 21 열기
service iptables restart
yum install -y vsftpd
/etc/vsftpd/vsftpd.conf 에서 설정
service vsftpd restart
계정 생성
useradd -d /var/ftp/ aaa
- trouble shooting
vi /etc/vsftpd/vsftpd.conf
pasv_enable=NO
vsftpd 재시작
/etc/init.d/vsftpd restart
'Linux' 카테고리의 다른 글
vim hex mode (0) | 2015.06.15 |
---|---|
memory setting using malloc() and practicing coding (0) | 2014.08.29 |
firewall and regulations for control net condition (0) | 2014.08.21 |
obtaining root position using telnet service system (0) | 2014.08.21 |
link options / xinetd (0) | 2014.08.18 |
xinetd를 이용한 root권한 획득후
-> 입력 리다이렉션을 이용한
-> 패스워드 초기화
->
--------------
- 방화벽(Firewall)
화이트 리스트 기반 - 명단에 있는 것만 허용
- 우선으로 모두 차단(all)후 등록된 것만 허용
블랙 리스트 기반 - 명단에 있는 것만 차단
- 차단만 등록
- 들어오는건 주로 차단 하지만 나가는건 잘 차단 안 함
---------------
- iptables Command
-A : append a Rule(--append)
ACCEPT
DROP
DENY - 허용하지 않는 메시지를 보냄 // 잘안 씀
-A INPUT -s 192.168.0.11 -p icmp -j ACCEPT
(출발지)
-A INPUT -p tcp -dport 7070 -j DROP
(도착지port)
-A OUTPUT -p udp -sport 6060 -j DROP
(출발지port)
---------------
TCP rapper
hosts.deny
in.telnetd:192.168.0.10
sshd:192.168.0.201
hosts.allow
----------
telnet root 접속 허용
/etc/securetty에
pts/0~9 까지 추가
----------------
last
/var/log/secure
'Linux' 카테고리의 다른 글
memory setting using malloc() and practicing coding (0) | 2014.08.29 |
---|---|
iptables and setting ftp server (0) | 2014.08.22 |
obtaining root position using telnet service system (0) | 2014.08.21 |
link options / xinetd (0) | 2014.08.18 |
Questions and I should find parts where need to be corrected (0) | 2014.08.14 |
link와 xinetd를 이용한 root 권한 획득
/etc/xinetd.d/telnet -> /home/user/.bash_history로 링크된 /tmp/user 파일 실행 ->
/etc/services
/etc/sysconfig/iptables
link -> /home/user/.bash_history
telnet원격 접속 -> /home/user/.bash_history 실행 -> vi -> chmod 777 /etc/passwd,
chmod 777 /etc/shadow
vi /etc/passwd -> root 비번 조작
'Linux' 카테고리의 다른 글
iptables and setting ftp server (0) | 2014.08.22 |
---|---|
firewall and regulations for control net condition (0) | 2014.08.21 |
link options / xinetd (0) | 2014.08.18 |
Questions and I should find parts where need to be corrected (0) | 2014.08.14 |
noticing who is connected inside and how would I kill them using the commands (0) | 2014.08.14 |
Inode - 파일을 찾아가는 주소
inode를 끊는것 -> 파일을 지운다
-> 하드디스크에는 실질적으론 지우는 기능은 없음, 덮어씀
hard link - inode 번호를 공유 (copy와 유사하지만 전혀 다른 개념)
- 내용수정, 권한 변경 하면 원본도 내용,권한 바뀜
symbolic link - 윈도우의 '바로가기' 와 같음 (파일 이름 기본) -> 파일 이름 바뀌면 못찾아감
* 리눅스에서는 디렉토리도 파일로 인식함
- 원본 파일 이름(포인터)
- 내용수정, 권한 변경 하면 원본도 내용,권한 바뀜 ->
-> 차이는 파일 이름으로 찾아간다는 것
----------
link를 이용해 지웠던 파일 되살리기(inode 되찾아 주기)
-----------
리눅스 설치
RPM
설치: rpm -Uvh 파일명 //잘 안씀
설치 확인 : rpm -qa 패키지 이름
- 의존성
코덱 > C++ > lib
-------
yum check-update - 특정 패키지 업데이트 확인
yum check-update ssh
yum update
yum remove
yum list sftp
yum 설정 파일
/etc/yum.conf
/etc/yum.repos.d/
------------
daemon
standalone - 24시간 혼자서 구동중
xinetd - 요청하면 구동, 요청을 받음
*d 가 붙으면 daemon
httpd
telnetd
snmpd
sshd
dhcpd
yum install telnet-server
-> xinetd 먼저 설치됨
설정 파일 폴더 : /etc/xinetd.d/telnet
포트 확인
/etc/service 확인
service xinetd start /restart /stop
방화벽 설정
/etc/sysconfig/iptables
누군가가 지웠거나, 방화벽 비활성화 되었을땐 iptables 내용 무
dport (destination port)
-A (룰을 추가하겠다)
input (server로 들어오는 것)
output (server에서 나가는것)
*허용/차단의 코드 순서를 따져야함
service iptables restart
yum install telnet // client 설치
telnet은 root로 직접 로긴 불가
pstree로 xinetd밑으로 프로세스가 있는것을 확인
'Linux' 카테고리의 다른 글
firewall and regulations for control net condition (0) | 2014.08.21 |
---|---|
obtaining root position using telnet service system (0) | 2014.08.21 |
Questions and I should find parts where need to be corrected (0) | 2014.08.14 |
noticing who is connected inside and how would I kill them using the commands (0) | 2014.08.14 |
figuring what is what using commands (0) | 2014.08.13 |