Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2018-04-Ubuntu Linux基礎 / 2018-04 Ubuntu

2018-04-Ubuntu Linux基礎 / 2018-04 Ubuntu

Cybozu

July 02, 2018
Tweet

More Decks by Cybozu

Other Decks in Programming

Transcript

  1.  =0 12 S 4 6 l l  =

    1 1 . 2 L4 6 l   l  lsb_release -a l 2
  2.   rmdir foo l D l ' ' '

    l D rm foo/bar l foo/bar rmdir foo l :
  3.    mkdir hoge touch hoge/piyo rm -r hoge

    l hoge "  l !"       sudo rm -rf /
  4.   , l less more lv  l q

    l l b  l ls -l /etc | less
  5.  less /etc/passwd l #! l %30 % /etc/shadow sudo

    less /etc/shadow l %'2,"1+ l '2,"  &-)/*. ( less /etc/group l $ !
  6.  nano l sudo apt install nano l S CV

    l E vim emacs l E l C ( + + E  + , )+ )
  7.  S l S O  S l sudo less

    /etc/shadow 0 l sudo id -a 0
  8.   ls -l /etc/shadow l -rw-r----- 1 root shadow

    978 Feb 6 14:30 /etc/shadow  cd; cp /etc/shadow ./ l shadow l ' / / / l P :  P -rw-r-----  root  shadow  978
  9.    !# 3- )&  "3- )& ./%

    '0 l ,5*" 1 2+ !# $.(4  -|rw-|r--|--- ",5* ",5" 1
  10.   sudo cp /etc/shadow ./ l root  

    shadow  l cp  & # !')root & # !$ %"  ls –l ./shadow l -rw-r----- 1 root root 978 Jun 29 17:46 ./shadow  sudo chmod 664 ./shadow l  664  l  1=x, 2=w, 4=r *(6=2+4=rw  ls –l ./shadow l -rw-rw-r-- 1 root root 978 Jun 29 17:46 ./shadow
  11.   less ./shadow l     

     touch ./shadow l touch: cannot touch 'shadow': Permission denied l ! "  sudo chown kota_uchida ./shadow l  # kota_uchida !  ls –l ./shadow l -rw-rw-r-- 1 kota_uchida root 978 Jun 29 17:46 ./shadow  touch ./shadow l  
  12. man 5 interfaces l D man man sudo nano /etc/network/interfaces

    auto eth0 iface eth0 inet static address I 12 5 netmask 255.255.240.0 gateway dns-nameservers
  13. sudo reboot l reboot  ifdown ifup  sudo ifdown

    eth0; sudo ifup eth0 ssh   l   ! 
  14.   OS d  OS d  ps ux

    l OS  sudo ps auxwwe | less l OS l e  kill PID l OS OS S l a OS l kill -9 -1
  15.       $ cat > sleep_echo.sh

    #!/bin/sh sleep $1 echo hello  $ chmod +x sleep_echo.sh
  16.        C  0

    l ./sleep_echo.sh 10 l C l / l fg/bg C Z l jobs 1 + ./sleep_echo.sh 10 & l +
  17.   l 0 P  true 0false P 

    S l true l echo $? l false l echo $? l set -e l false $? "
  18.   l a e l ( () d3 

    man 3 daemon l sudo apt install manpages-dev l man 3 daemon
  19.  0 - cn b : : Wa U 0

    - h ld i  m b je l / 6 -. 16 . - /.- 0 1 2 . # -. .2 6 . -. -. .2 6 . -. / 2 0 - 20 :
  20. 

  21.    l man bash l sudo apt install

    bash-doc; info bash  ) ( l chsh l ) ,