OS/Linux 2014. 4. 8. 19:11

-O file

--output-document=file

The documents will not be written to the appropriate files, but all will be concatenated together and written to file.  If - is used as file, documents will be printed to standard output, disabling link conversion.  (Use ./- to print to a file literally named -.)

Use of -O is not intended to mean simply "use the name file instead of the one in the URL;"

rather, it is analogous to shell redirection: wget -O file http://foo is intended to work like wget -O - http://foo > file; file will be truncated immediately, and all downloaded content will be written there.


예제

# wget -O - http://url/script | bash

위와 같은 command로 스크립트를 로컬에 다운받지 않고 바로 실행 할 수 있다.


생각해보기 


위와 같은 command를 사용하면 간편할 수는 있다. 하지만 시스템 운영자의 입장에서 좋은 것일까??


기본적으로 방화벽으로 보호가 되어 있다는 전제가 있겠지만, 만약 외부에서 원격으로 스크립트를 실행할 수 있다면, 보안 취약점으로 볼수 있다. 이에 대한 대비를 충분히 해야 하는데, 어떤 방법으로 이를 방지할 수 있을까??


웹 서버를 구성하게 되면 옵션을 이용해서 스크립트를 실행을 막을 수 있다.

아직 이에 대한 테스트를 진행해 보진 못하였지만, 기회가 되면 이에 대한 테스트도 진행해 보는 것이 좋을 것 같다.

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

daemon.log 사용  (0) 2014.04.18
kern.log 설정  (0) 2014.04.18
hostname  (0) 2014.04.10
기본 텍스트 에디터 변경  (0) 2014.04.09
리눅스 <-> 윈도우 텍스트 파일 복사 시 한글깨짐  (1) 2014.04.08
posted by 구닥다리 엔지니어
: