2015. 7. 17. 05:39

SCP

> scp source_file_nam username@destination_host:destination_folder

example)

scp Download/A.txt cooldragon@192.168.56.10:/home/cooldragon


SFTP

Posted by CoolDragon
2015. 7. 17. 04:47

1. firewall (refer to https://help.ubuntu.com/lts/serverguide/firewall.html)

   > sudo ufw enable

   > sudo ufw allow 22


2. netstat

   > sudo netstat -plant | grep ssh


3. install ssh (http://cooldragon.tistory.com/139)

  > sudo apt-get install openssh-server


connection test from other terminal)

> ssh account@IP

> ssh cooldragon@192.168.56.102

Posted by CoolDragon
2014. 5. 14. 19:08

1) root 권한 획득

  $ sudo -s


2) 계정생성

  # useradd 사용자ID


3) 비밀번호생성

  # passwd test


4) 계정삭제

  # userdel 사용자ID


5) 계정생성확인

   vi /etc/passwd

   vi /etc/shadow

   vi /etc/group


6) root 권한 주기

"사용자ID  is not in the sudoers file.  This incident will be reported." 라고 메시지가 나온다면..

# vi /etc/sudoers 하면 아래 내용에 다음과 같은 줄이 있다.

....

   root ALL=(ALL) ALL #처럼 바래 아래 줄에

   사용자ID ALL=(ALL) ALL #으로 동일하게 설정해준다.

....


Posted by CoolDragon
2014. 4. 11. 00:49

sudo apt-get remove openssh-client openssh-server

sudo apt-get update

sudo apt-get install openssh-client openssh-server

Posted by CoolDragon
2014. 4. 11. 00:45

Set Network

- first of all, you should check mac address

  - Adaptor 1 :  NAT

  - Adaptor 2 :  Host Dedicated Adaptor


[Install Ubuntu]

- set static IP

$ sudo vi /etc/network/interfaces

  auto lo

  iface lo inet loopback


  auto eth0 # NAT 

  iface eth0 inet dhcp


  auto eth1 # Host Dedicated Adaptor

  iface eth1 inet static

        address 192.168.56.102   # you can find the basic IP(192.168.56.1) in network tab, VirtualBox preference

        netmask 255.255.255.0


$ sudo /etc/init.d/networking restart

#새로 추가된 IP에 매칭된 이더넷카드 실행을 해준다.

$ sudo ifdown eth0

$ sudo ifdown eth1

$ sudo ifup eth0

sudo ifup eth1


$ nslookup www.daum.net

  ※ if you can't well, please see this link

     (http://forum.falinux.com/zbxe/index.php?document_srl=532721&mid=lecture_tip)

     $ vi /etc/udev/rules.d/70-persistent-net.rules

     $ sudo rm /etc/udev/rules.d/70-persistent-net.rules




더 설명이 좋은 링크: https://gist.github.com/wacko/5577187

Posted by CoolDragon
2013. 10. 16. 10:47

[CentOS]

# vi /etc/sysconfig/iptables (방화벽 설정 파일 편집)


-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT (를 추가하면 22 포트 방화벽 사용)


# /etc/init.d/iptables restart  (포트 변경후 재시작)

※ 가끔 포트 추가시 입력 위치에 따라서 정상적으로 적용되지 않는 경우도 있으니 주의할 것


[Ubuntu]

sudo ufw enable # file enable

> sudo ufw allow ssh # open ssh port

> sudo ufw allow 4444/tcp      # tcp 80 port open

> sudo ufw allow 80/tcp          # tcp 80 port open

> sudo ufw show added           # show the list of what user added on filewall


Posted by CoolDragon