next up previous contents
Next: 正確的關機 Up: 文字命令 Previous: 登入系統   Contents

指令下達

  1. 格式
    [root@deyu dywang]# command [ -options ] parameter1 parameter2 ...
    指令 選項 參數1 參數2
    1. Linux 環境下,大小寫不同;
    2. 選項可不指定, [ ] 並不存在於實際的指令中,通常以 "-" 加入選項設定,有時完整參數名稱以 "--" 輸入;
    3. 指令、選項及參數間以空格區分(個數不拘);
    4. 按下 [Enter],開始執行指令。
    5. 指令太長可以跳脫字元 "\" ,跳脫 [Enter]動作,換行繼續輸入。
  2. 切換至root身份
    [dywang@deyu ~]$ su -
    [root@deyu ~]#
    
  3. 以ssh連線至虛擬機
    [root@deyu ~]# ssh root@kvm4.deyu.wang
    The authenticity of host 'kvm4.deyu.wang (192.168.122.4)' can't be established.
    RSA key fingerprint is f2:04:37:1e:5b:7c:86:0d:c6:c6:3e:6b:85:a7:5d:6f.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'kvm4.deyu.wang' (RSA) to the list of known hosts.
    root@kvm4.deyu.wang's password: 
    Last login: Tue Dec 20 09:00:03 2011
    [root@kvm4 ~]# w
     09:10:19 up 32 min,  1 user,  load average: 0.00, 0.00, 0.00
    USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
    root     pts/0    deyu.wang        09:09    0.00s  0.04s  0.01s w
    [root@kvm4 ~]# ls
    anaconda-ks.cfg  install.log  install.log.syslog
    [root@kvm4 ~]# exit
    logout
    Connection to kvm4.deyu.wang closed.
    [root@deyu ~]# cat ~/.ssh/known_hosts
    kvm4.deyu.wang ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAlUrRxmSY4ngrTFj1dpW9XzHdgzNxl2Dt3rwpMui8UlieYiedHMKzqMoBjN72OzBxPbT/E1aYUlwZeY60kbvQMcZ3RZYrT3zhnhVAzQPJ4RfqBEBG3xVdH2amz630KKOnPn5tBFG3EnHu3ot+bL/ArNTFDIKfUkuY9LBASgjCxIw/lUlVUZNcpo+3EpBryzWZ7DzNahgctQ0CU10FXJDqxLKM9VSzugrUMhf+tjb3OTyf8PM+g8DDFFifWinNa9qoBf6s5fZajj/xANhTw2OYgn/jETSXtTOZVZ3K7vcABwdnfwNkBnGnxn9jo1ND5QzITqRmBGWDa1M6W5pnp+xPUQ==
    [root@deyu ~]# ssh root@kvm4.deyu.wang
    root@kvm4.deyu.wang's password: 
    Last login: Tue Dec 20 09:09:55 2011 from deyu.wang
    [root@kvm4 ~]# exit
    logout
    Connection to kvm4.deyu.wang closed.
    [root@deyu ~]# rm ~/.ssh/known_hosts
    [root@deyu ~]# ssh root@kvm4.deyu.wang
    root@kvm4.deyu.wang's password: 
    Last login: Sun Jan  1 16:41:28 2012 from 192.168.122.1
    [root@kvm4 ~]#
    



2015-04-13