linux ssh以及dropbear

來源:互聯網
上載者:User

標籤:linux   ssh.dropbear   

telnet:遠程登入協議

採用c/s架構,全程使用明文。

應用程式層協議,工作在tcp 23連接埠。

S:telnet伺服器

C:telnet用戶端



ssh:Secure Shell 

應用程式層協議,工作在tpc 22連接埠。

通訊過程及認證過程都是加密的,基於主機認證。

使用者認證過程加密

資料轉送過程加密



主機密鑰hostkey:

非對稱式加密

secert key

public key


openssh:

伺服器端:sshd

設定檔:/etc/ssh/sshd_config


用戶端:ssh

設定檔:/etc/ssh/ssh_config


#ssh-keygen [OPTION] 金鑰產生器

[OPTION]

-t TYPE 指定加密方式,常用的為rsa|dsa

-f KEYFILE 指定私密金鑰檔案。

-P ‘PASSWORD‘ 指定加密私密金鑰的密碼,‘‘表示空密碼。


產生的密鑰存放在:

/home/USERNAME/.ssh/id_rsa 產生的私密金鑰

/home/USERNAME/.ssh/id_rsa.pub 產生的公開金鑰


注意:.ssh檔案夾的許可權只能為700!


產生的公開金鑰將儲存到遠程主機USERNAME的家目錄下的相關檔案中,只能追加,不能覆蓋:

/home/USERNAME/.ssh/authorized_keys

或

/home/USERNAME/.ssh/authorized_keys2


檔案的許可權為600!


例如:

#ssh-keygen -t rsa

#scp /root/.ssh/id_rsa.pub [email protected]:/tmp

#ssh [email protected] ‘cat /tmp/id_rsa.pub >> /home/hadoop/.ssh/authroized_keys‘


或

#ssh-keygen -t rsa -f .ssh/id_rsa -P ‘‘ 

#ssh-copy-id -i [email protected]



#ssh-copy-id  [OPTION] [[email protected]]HOST 將公開金鑰傳輸至遠程伺服器

[OPTION]

-i PUBKEYFILE 指定公開金鑰檔案


例如:

#ssh-copy-id -i .ssh/authorized_keys [email protected]


#scp [OPTION] SRC DEST 跨主機安全複製工具。

[OPTION]

-r 遞迴

-a 全部


SRC

[email protected]:DIR

LOCALDIR


DEST

[email protected]:DIR

LOCALDIR


例如:

#scp /root/busybox.tar.gz [email protected]:/home/hadoop/ 


#scp [email protected]:/home/hadoop/busybox.tar.gz /root/



#ssh [OPTION] [[email protected]]HOST ‘COMMAND‘

[OPTION]

-l USERNAME HOST


從伺服器接受的主機密鑰存放檔案:

/home/USERNAME/.ssh/kown_hosts




dropbear:嵌入式系統專用的ssh伺服器端和用戶端工具

伺服器端:dropbear

密鑰產生工具:

dropbearkey


用戶端:dbclient


dropbear預設使用nsswitch進行名稱解析


nsswitch所需檔案:

/etc/nsswitch.conf

/lib/libnss_file*

/usr/lib/libnss3.so

/usr/lib/libnss.file*



dropbear或在使用者登入時檢查其預設shell是否為當前系統的安全shell。安全shell在/etc/shells內進行定義。



主機密鑰預設位置:

/etc/dropbear/

dorpbear_rsa_host_key

長度可變,是8的倍數即可,預設為1024

dorpbear_dss_host_key

長度固定,預設為1024


#dropbearkey [OPTION]

-t TYPE rsa|dsa

-f KEYFILE

-s SIZE


本文出自 “小私的blog” 部落格,請務必保留此出處http://ggvylf.blog.51cto.com/784661/1616796

linux ssh以及dropbear

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.