1월, 2016의 게시물 표시

raspberry pi password reset (라즈베리파이 패스워드 리셋/초기화)

Step 1 – Grab The SD Card Power down the Pi and remove the SD card. Insert it into your PC. Step 2 – Edit cmdline.txt The boot partition should be visible and contain a file named “cmdline.txt”. Edit this file in a text editor and add the following to the end of the existing text : init=/bin/bash   If the original content was : dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait it should now look like : dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait  init=/bin/bash   Make sure it is all one line! Save the text file and eject the SD card from the PC. Step 3 – Reset the Password Insert the card into a Pi that is connected to a monitor and keyboard. Power up the Pi. There may be a delay but you should be presented with a flashing cursor. At the prompt type the following command :

ubuntu 에서 외장하드 ( NTFS ) 공유하기

ubuntu 에서 외장하드 ( NTFS ) 공유하기(15.10확인) 1. 자동마운트 혹은 영구마운트 (fstab수정 혹은 sudo apt-get install usbmount) 2.  /etc/samba/smb.conf 수정 ( ntfs는공유시 권한이 제대로 동작하지 않음) [global] usershare owner only = false 3. 해당 폴더에 가서 마우스 오른쪽으로 공유하기.  폴더-->마우스오른쪽버튼-->로컬네트워크공유 ubuntu 에서 ubuntu 내의 ( ext4 포맷 등) 폴더를 공유하는 것은, 윈도와 마찬가지로 마우스 오른쪽 버튼을 눌러 공유 기능을 켜면 바로 해결된다. 참고)영구 마운트 방법 영구마운트의 경우 원하는 위치에 마운트시켜줄 수 있고 부팅하면서 바로 붙는다. usbmount사용 시 자동으로 마운트되나, 상황에 따라 계정밑에 혹은 usb에 붙기도 한다. (/media/user1/external, /media/usb) 대상확인(/dev/sdb) sudo fdisk -l | grep /dev/sd #연결된 디스크 및 파티션 확인 마운트할 위치의 빈 폴더 만들기(확인용), 마운트, 확인 영구마운트정보를 잘못 기록한 경우 부팅하면서 중단되므로 미리 확인한다. 만약 이 상황이 발생했다면,   vi /etc/fstab   이후에 해당 항목을 지워주고 부팅을 다시 진행하면 된다. sudo mkdir /media/storage sudo mount /dev/sdb2 /media/storage sudo fdisk -l | grep /dev/sdb2 영구마운트(권한포함) : ntfs는 공유 시 권한이 제대로 동작하지 않아 영구마운트 필요.(확실하지 않음) 1)루트권한으로 쉘을 연다 2)/dev/sdb2 를 /media/storage에 마운트한다. 타입은 fuseblk(사용자블럭디바이스), 권한이나 기타 설정은 defaults로, 덤프대상 아니며, 오류체크는 하지 않는다.
SSH 간편하게 사용하기 (리눅스) ( ssh keygen ) 나만의 패스워드로 접속 가능하게 하거나, 패스워드 없이 접속하거나. ssh-keygen -t rsa  ssh-copy-id userid@remote_host ssh userid@remote_host 1. SSH 키 생성 (로컬에서 )  ssh-keygen -t rsa 그리고 엔터세번(패스워드를 입력하면 ssh 접속시 패스워드 물어봄) $ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/hs/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again:   ...  The key's randomart image is: +---[RSA 2048]----+ |   ...           | |    . .          | |     . .         | |     ..o.        | |      ooS .      | |      .*.+ o ..  | |      o.=oo=+=+  | |  E  ..*o.= #Bo. | |   oo o+o+.Bo=o..| +----[SHA256]-----+ 2. SSH 키 전송 방법 1) ssh-copy-id userid@remote_host 방법2) cat ~/.ssh/id_rsa.pub | ssh userid@remote_host 'cat >> ~/.ssh/authorized_keys'  3. 보안강화 chmod 700 ~/.ssh chmod 600 ~/.ssh/id_rsa chmod 644 ~/.ssh/id_rsa.pub chmod 644 ~/.ssh/authorized_keys chmod 644 ~/.ssh/known_