ssh를 이용하여 파일을 전송할 수 있는 방법을 소개한다.
SCP: A Secure Alternative to FTP
From a networking perspective, FTP isn't very secure, because usernames, passwords, and data are sent across the network unencrypted. More secure forms such as SFTP (Secure FTP) and SCP (Secure Copy) are available as a part of the OpenSSH package that is normally installed by default on RedHat and Fedora Core. Remember, unlike FTP, SCP doesn't support anonymous downloads like FTP.
The Linux scp command for copying files has a format similar to that of the regular Linux cp command. The first argument is the source file and the second is the destination file. When copying to or from a remote server, SCP logs in to the server to transfer the data and this therefore requires you to supply a remote server name, username, and password to successfully execute the command. The remote filename is therefore preceded by a prefix of the remote username and server name separated by an @ symbol. The remote filename or directory then follows separated by a colon. The format therefore looks like this:
username@servername:filenameusername@servername:directoryname
For example, file /etc/syslog.conf on a server with IP address 192.168.1.100 that needs to be retrieved as user peter would have the format peter@192.168.1.000:/etc/syslog.conf, the entire /etc directory would be peter@192.168.1.000:/etc/.
Note: You can download an easy-to-use Windows SCP client called WinSCP from http://winscp.vse.cz/eng/
Copying Files To The Local Linux Box
If you understand how scp represents remote filenames, you can start copying files fairly easily. For example, to copy file /tmp/software.rpm on the remote machine to the local directory /usr/rpm use the commands
[root@bigboy tmp]# scp root@smallfry:/tmp/software.rpm /usr/rpmroot@smallfry's password:software.rpm 100% 1011 27.6KB/s 00:00[root@bigboy tmp]#
To copy the file /tmp/software.rpm on the remote machine to the local directory /usr/rpm using TCP port 435, use the commands
[root@bigboy tmp]# scp -P 435 root@smallfry:/tmp/software.rpm /usr/rpmroot@smallfry's password:software.rpm 100% 1011 27.6KB/s 00:00[root@bigboy tmp]#
'unix and linux' 카테고리의 다른 글
SecureCRT를 이용하여 파일 송신하기 (0) | 2007.08.24 |
---|---|
perl에서 slash('/')를 바꾸기(replace) (0) | 2007.08.22 |
시스템 부팅시 프로세스 시작하기 (0) | 2007.08.16 |
리눅스 부팅 순서 (0) | 2007.08.16 |
/proc/net/tcp 보기 (0) | 2007.08.02 |
1. /etc/rc.local 파일에 추가
2. /etc/rc?.d/S 스크립트 작성
'unix and linux' 카테고리의 다른 글
perl에서 slash('/')를 바꾸기(replace) (0) | 2007.08.22 |
---|---|
ssh를 이용한 파일 전송 방법 (0) | 2007.08.21 |
리눅스 부팅 순서 (0) | 2007.08.16 |
/proc/net/tcp 보기 (0) | 2007.08.02 |
/proc/net/dev (0) | 2007.08.02 |
참고 자료.
http://oldfield.wattle.id.au/luv/boot.html
http://ourworld.compuserve.com/homepages/KanjiFlash/BPTour.htm
http://www.linux.com/articles/114107
리눅스 부팅순서를 공부해보았다.
구글에서 검색할 때는 "boot order"보다는 boot sequence 또는 boot process 가 어울린다.
부팅 순서는 크게 다음과 같다.
1. 바이오스
2. MBR
3. LILO(GRUB)
4. 커널
5. init
6. Run level
자세히 들어가보자.
1. BIOS
내용은 생략..
2. MBR
Master boot record
bios는 디스크의 첫번째 512바이트를 읽고 실행한다. 일명 부트 로더를 읽는다.
보통 리눅스에 경우는 /dev/hda 위치하는 부분을 읽는다.
그 이유는 리눅스는 /dev/had1~4까지 bootable이라고 마킹해둔 primary 영역을 찾는다. 그 영역을 찾아 읽고 실행한다.
3. LILO(GRUB)
메뉴코드를 읽는다. 보통 /boot/boot.b 에 저장되어 있다.
프롬프트를 먼저 보이고, 해당되는 커널이미지 옵션을 읽는다.
커널이미지와 부트영역과 모듈을 카피하여 실핵한다.
다음과 같이 뜰 것이다.
Loading linux-2.2.12..........
4. 리눅스 커널 로딩
linux/init/main.c 에 해당 소스가 있다. 여기에 부팅 커널관련된 부팅순서의 내용이 들어가 있다.
처음엔 프로세서, 콘솔, 메모리를 초기화한다.
두번째, PCI 버스를 초기화한다.
세번째, 네트웍을 초기화한다.
네번째 프로세스 번호 0 인 커널 IDLE 쓰레드가 실행된다. (/sbin/init )
다섯번째, 드바이스 드라이버를 초기화한다.
(Generice Parallel port, character device, block device, scsi, ppp, disk)
* Root 파일 시스템을 읽기 전에 램디스크 이미지를 읽기도 한다. 해당 내용은 아래를 참조하라 /usr/src/linux-2.4.21-47.EL/Documentation/initrd.txt
5. Process 번호 1번 프로그램 실행
/sbin/init의 연장인데, 굳이 번호를 따지 않아도 되고... run level때문에 분류..
/etc/inittab을 읽어 /etc/rc.d/rc.sysinit을 실행한다. 이 스크립트에는 모듈을 로드하고, 루트 파일 시스템, 마운트 파일시스템, 네트우거 셋팅, 리모트 파일 시스템 마운팅, 폰트, tty, 로긴이후의 배너(/etc/redhat-release), 시계 설정, 커널 파라미터 기타 하드웨어 디바이스 설정 정보가 들어가 있다.
그후, /etc/inittab 파일에서 id:3:initdefault: 줄을 찾아 해당 runlevel을 실행시킨다.
정확하게 말하면 initdefault으로 지정된 값에 해당되는 /etc/rd?.d/S* 스크립트를 실행한다.
참고로 run level은 다음과 같다.
|
/etc/init.d/rc가 3일 파라미터로 받아. /etc/rc3.d의 S (Start)스크립트를 실행한다.
* init 명령어를 이용하여 runlevel이 수정 가능하고, 부팅이후, init 명령어에 의해 K(kill), S(start) 스크립트가 실행된다.
/etc/init.d/rc.local 파일은 부팅할때 띄우는 데몬이 프로그램을 적는데 사용된다.
그리고, virtual 콘솔 tty를 셋업한다. (mingtty )
/sbin/login이 실행되어 사용자 이름과 패스워드를 넣는 부분 앞에 /etc/issue 파일의 내용을 화면에 뿌린다.
6. bash shell 실행 (가정)
로그인후, /etc/motd 파일의 내용을 출력한다.
그리고 /etc/passwd파일의 계정정보를 이용하여 쉘을 파악한다.
/etc/profile을 실행하여 모든 사용자의 시스템 환경 변수를 셋팅한다.
그리고, 개인 설정는 본인 디렉토리의 .profile .bashrc파일을 읽어서 셋팅된다.
'unix and linux' 카테고리의 다른 글
ssh를 이용한 파일 전송 방법 (0) | 2007.08.21 |
---|---|
시스템 부팅시 프로세스 시작하기 (0) | 2007.08.16 |
/proc/net/tcp 보기 (0) | 2007.08.02 |
/proc/net/dev (0) | 2007.08.02 |
Yum (0) | 2007.06.07 |
/proc/net/tcp, udp, raw는 각각 열려있는 tcp, udp, raw 소켓을 알려준다.
참조
http://linuxdevcenter.com/pub/a/linux/2000/11/16/LinuxAdmin.html
sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode
0: 00000000:0203 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 335 1 c1674320 300 0 0 0
1: 00000000:0025 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 310 1 c16799a0 300 0 0 0
2: 00000000:0369 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 316 1 c1677ca0 300 0 0 0
...
...
16: 0100007F:0408 0100007F:0017 01 00000000:00000000 00:00000000 00000000 1000
[dev1:/home1/knight/perl] cat /proc/net/tcp | wc -l
1331
[dev1:/home1/knight/perl] cat /proc/net/raw | wc -l
1
[dev1:/home1/knight/perl] cat /proc/net/udp | wc -l
1
'unix and linux' 카테고리의 다른 글
시스템 부팅시 프로세스 시작하기 (0) | 2007.08.16 |
---|---|
리눅스 부팅 순서 (0) | 2007.08.16 |
/proc/net/dev (0) | 2007.08.02 |
Yum (0) | 2007.06.07 |
Virtual Box 설치하기 (0) | 2007.06.07 |
시스템 업무를 하면서 반드시 필요한 정보이다. 현재 네트웍 장비에 대한 정보와 트래픽 정보를 얻어 낼 수 있다.
모니터링시 네트웍 상황을 얻어올 때, 유용할 수 있다. rrd랑 쓰면 모니터링이 가능할 것이다.
참조자료.
http://linuxdevcenter.com/pub/a/linux/2000/11/16/LinuxAdmin.html
cat /proc/net/dev 명령어를 치면 다음과 같이 나올 것이다.
Inter-| Receive | Transmit face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed lo:111787507 281326 0 0 0 0 0 0 111787507 281326 0 0 0 0 0 0 eth0:161543042 916321 0 0 0 0 0 43431 103791415 767750 0 0 0 8664 0 0
실제 필드의 내용은 다음과 같다.
bytes
The total number of bytes of data transmitted or received by the interface.
packets
The total number of packets of data transmitted or received by the interface.
errs
The total number of transmit or receive errors detected by the device driver.
drop
The total number of packets dropped by the device driver.
fifo
The number of FIFO buffer errors.
frame
The number of packet framing errors.
colls
The number of collisions detected on the interface.
compressed
The number of compressed packets transmitted or received by the device driver. (This appears to be unused in the 2.2.15 kernel.)
carrier
The number of carrier losses detected by the device driver.
multicast
The number of multicast frames transmitted or received by the device driver.
'unix and linux' 카테고리의 다른 글
리눅스 부팅 순서 (0) | 2007.08.16 |
---|---|
/proc/net/tcp 보기 (0) | 2007.08.02 |
Yum (0) | 2007.06.07 |
Virtual Box 설치하기 (0) | 2007.06.07 |
페도라 설치 (0) | 2007.06.06 |
세상 겁나 좋아졌다.
rpm-> 유분투의 모듈 업데이트 시스템 -> yum을 이용한 손쉬운 설치!!! 짱인데.
로그 확인
cat /var/log/yum.log
설치
yum install 패키지
변경
yum update 패키지
설치 여부 확인
yum search 패키지
설치 리스트 확인
yum list
http://www.phy.duke.edu/~rgb/General/yum_HOWTO/yum_HOWTO/
Next Previous Contents
Yum (Yellow dog Updater, Modified) HOWTO
Robert G. Brown, rgb at phy.duke.edu
Jonathan Pickard,fatboy at techno.co.za
0.3, 2003-09-24
This is a HOWTO for Yum: the Yellow dog Updater, Modified. Yum is an automatic updater and package installer/remover for rpm-based systems. It automatically computes dependencies and figures out what things should occur in order to safely install, remove, and update rpm packages. Yum also efficiently and easily retrieves information on any package installed or available in a repository to the installer. Yum makes it easier to maintain groups of machines without having to manually update each one using rpm or other tools. Yum can manage package groups, multiple repositories, fallback repositories and more to permit centralized package management performed by just one or two individuals to scale over an entire organization. Note Well! This HOWTO is in a state of total flux during its initial pre-release development. Lots of sections are empty, others are wrong, all is in a state of mediocre organization. Nevertheless, I cherish feedback from anybody on the basis of any snapshot you happen to see.
1. Introduction
- 1.1 What Yum Can Do
- 1.2 How Yum Works
- 1.3 Yum, RPM, and Red Hat
- 1.4 A Plea for Karmic Balance
- 1.5 RPM Repository Madness
- 1.6 Copyright
- 1.7 Disclaimer
- 1.8 News
- 1.9 Credits/Acknowledgements
2. HOWTO Organization
3. Useful Links:
4. Preliminaries
5. Planning a Yum Repository
6. Setting up an FTP server for yum.
- 6.1 Download the RPM
- 6.2 Install the ftp server.
- 6.3 Edit the vsftpd.conf file
- 6.4 Start the server
- 6.5 Testing the FTP server
7. Building Yum
8. Installing Yum
9. Yummifying your servers: yum-arch
10. Setting up the Yum Client
- 10.1 /etc/yum.conf
- 10.2 /etc/cron.daily/yum.cron
- 10.3 /var/cache/yum
- 10.4 Distributing the Configuration
11. Using the Yum Client
12. Building RPMs for yum repositories
13. Security
14. Etc.
15. Further Information
Next Previous Contents
'unix and linux' 카테고리의 다른 글
/proc/net/tcp 보기 (0) | 2007.08.02 |
---|---|
/proc/net/dev (0) | 2007.08.02 |
Virtual Box 설치하기 (0) | 2007.06.07 |
페도라 설치 (0) | 2007.06.06 |
Richard Stevens (0) | 2006.07.20 |
Virtual Box 설치하기
VirtualBox 홈페이지에서 윈도우 버젼을 다운받는다.
http://www.virtualbox.org/wiki/Downloads
VM 생성하기
- New ( 또는 VM -> New )를 선택하여 New Virtual Machine Wizard!를 실행한다.
- VM Name 과 OS Type 을 지정한다.
- Memory에서는 그냥 wizard가 설정해 놓은대로 그냥 Next하라. 288메가가 적당할 것 같다.
- 그다음 부트 하드디스크가 없으면, 새로 이미지를 만든다.
- Image Type 선택하고 Image File Name, Image Size 설정한다. 한 여유있게 Fixed 메모리 image로 잡는 것이 좋다. 보통 5~6G로 잡는 것 같다.
- Next하면 Summary 정보가 보이고 Finish를 눌러 New Virtual Hard Disk Wizard!를 종료한다.
- 처음의 VirtualBox 화면으로 돌아 와서 해당 vm을 선택하고 Setting 버튼을 선택한다.
- 비디오 메모리와 베이스 메모리 크기를 결정한다. (나는 base memory를 300M, video memory를 24M로 결정)
- 설치를 해야 하니까. CD/DVD-ROM을 클릭하여 Mount CD/DVD-ROM Driver 체크 박스를 체크하고 ISO 파일을 지정한다.
리눅스 설치할 사람은 fedora -live를 이용하라. 아주 설치가 쉽다.
- 설치 후에 Mount CD/DVD-ROM Driver 체크 박스를 체크오프한다.
VM 실행
지정된 CD/DVD 혹은 ISO 파일을 읽어서 실행된다.
Hot Key
Host Key는 초기설정은 R-Ctrl
Host Key 변경은 File->Global Settings의 Input Key섹션에서 수정
OS 간 전환 : Host
전체 화면 전환 : Host + F
창 크기 변경 : Host + A
게스트 화면에 맞춰 자동조정 : Host + G
마우스 통합 중지하기 : Host + I
Ctrl+Alt+Del 보내기 : Host + Del
Ctrl+Alt+Backspace 보내기 : Host + Backspace
스냅샷 찍기 : Host + S
게스트 일시 중지 : Host + P
게스트 재부팅 : Host+ R
닫기 : Host + Q
기타
- 파일 공유 , 클립보드 설정이 가능하다. 자세한 것 매뉴얼 참조~
'unix and linux' 카테고리의 다른 글
/proc/net/dev (0) | 2007.08.02 |
---|---|
Yum (0) | 2007.06.07 |
페도라 설치 (0) | 2007.06.06 |
Richard Stevens (0) | 2006.07.20 |
[펌] ssh 포트(22번) 변경하기 (0) | 2006.01.21 |
'unix and linux' 카테고리의 다른 글
Yum (0) | 2007.06.07 |
---|---|
Virtual Box 설치하기 (0) | 2007.06.07 |
Richard Stevens (0) | 2006.07.20 |
[펌] ssh 포트(22번) 변경하기 (0) | 2006.01.21 |
unix vi 명령 (0) | 2005.02.28 |
이 책의 2판은 2005년도에 나왔는데, Stevens가 1999년도에 사망했다는 얘기를 듣고 이 사람에 대해서 좀 알아 보려고, 구굴에서 Richard Stevens를 검색했더니 그 자신이 쓴 일대기를 볼 수 있었다.
http://www.kohala.com/start/bio1.html
http://www.kohala.com/start/
UNIX와 소프트웨어의 큰 획을 그으신 분이 어떻게 돌아가셨나 구글링을 한 결과, 다음과 같은 글을 발견했다.
W. Richard Steven noted technology author and teacher died last Wednesday. Stevens was best known for his UNIX Network Programing series and and TCP/IP Illustrated book. The family has asked that in lieu of flowers, be made in Richard's name to Habitat for Humanity, 2950 E. 22nd Street, Tucson, AZ 85713. He is survived by his wife and three children. The cause of death was not reported.
(http://www.hackcanada.com/hackcanada/media/hnn090899.html)
Born: 1951
Birthplace: Luanshya, Northern Rhodesia
Died: 1-Sep-1999
Location of death: Tucson, AZ
Cause of death: unspecified
Gender: Male
Ethnicity: White
Occupation: Author
Nationality: United States
(http://www.nndb.com/people/948/000023879/)
그의 죽음은 불명확한 돌연사인듯 하다. 너무 열심히 산 까닭일런지는 모르겠다. 특이한 점은 그가 해비타트와 연관이 있다는 점이 그가 어떻게 인생을 살았는지 알아 보는 것도 괜찮을 것 같다라는 생각이 들었다. 48살에 운명을 달리했지만, 그 사람이 아니었다면, IT의 역사가 거꾸로 갔을 지도 모르겠다라는 생각이 든다.
'unix and linux' 카테고리의 다른 글
Yum (0) | 2007.06.07 |
---|---|
Virtual Box 설치하기 (0) | 2007.06.07 |
페도라 설치 (0) | 2007.06.06 |
[펌] ssh 포트(22번) 변경하기 (0) | 2006.01.21 |
unix vi 명령 (0) | 2005.02.28 |
ssh 포트(22번) 변경하기 | |||||||||
|
'unix and linux' 카테고리의 다른 글
Yum (0) | 2007.06.07 |
---|---|
Virtual Box 설치하기 (0) | 2007.06.07 |
페도라 설치 (0) | 2007.06.06 |
Richard Stevens (0) | 2006.07.20 |
unix vi 명령 (0) | 2005.02.28 |