OpenSSH

OpenSSH
"Keeping your communiqués secret"
"Keeping your communiqués secret"
開發者OpenBSD計畫組
首次发布1999年12月1日,​24年前​(1999-12-01
当前版本
  • 9.7 (2024年3月11日;穩定版本)[1]
編輯維基數據鏈接
源代码库
  • anongit.mindrot.org/openssh.git
編輯維基數據鏈接
编程语言C语言
操作系统跨平台[2]
标准RFC 4250, RFC 4251, RFC 4252, RFC 4253, RFC 4254, RFC 4255, RFC 4256, RFC 4335, RFC 4344, RFC 4345, RFC 4419, RFC 4462, RFC 5656, RFC 6594, RFC 6668, RFC 7479[3]
类型远程访问
许可协议简化版BSD许可证
ISC許可證
公共领域
网站www.openssh.com/ 编辑维基数据

OpenSSHOpenBSD Secure Shell)是使用SSH透過計算機網路加密通訊的實現。它是取代由SSH Communications Security所提供商用版本的開放原始碼方案。目前OpenSSH是OpenBSD的子計畫。

OpenSSH常常被誤認以為與OpenSSL有關聯,但實際上這兩個計畫有不同的目的,不同的發展團隊,名稱相近只是因為兩者有同樣的軟體發展目標──提供開放原始碼的加密通訊軟體。

歷史

OpenSSH是在1999年10月第一次在OpenBSD 2.6裡出現,當初的計畫是取代由SSH Communications Security所提供的SSH軟體。

發展及程式架構

程式主要包括了幾個部份:

  • ssh
rlogin英语rloginTelnet的替代方案。
  • scpsftp
rcp的替代方案,將檔案複製到其他電腦上。
  • sshd
SSH伺服器。
  • ssh-keygen
產生RSAECDSA金鑰,用來認證用。
  • ssh-agentssh-add
幫助使用者不需要每次都要輸入金鑰密碼的工具。
  • ssh-keyscan
掃描一群機器,並记錄其公鑰

常见用法

ssh -V #查看版本

一般在个人主目录下的.ssh子目录中的authorized_keys文件为公钥,可用于ssh通过公私秘钥认证方式登录操作系统。

ssh会把访问过的主机的公钥(public key)记录在~/.ssh/known_hosts。当下次访问相同计算机时,OpenSSH会核对公钥。如果公钥不同,OpenSSH会发出警告, 避免受到DNS Hijack之类的攻击。

通过ssh可以直接远程执行目标机上的命令行: ssh username@host "command_line" 注意使用单引号或者双引号把命令行包围起来(还可以多行输入)。如果被执行的命令行需要与用户交互(需要 TTY),应该使用-t选项,例如 ssh -t username@host "command_line"

通过ssh可以远程执行本地脚本,如 ssh username@host < my.sh ,但在Windows上暂时可能不行。如果本地脚本带有命令行参数,需要如此格式: ssh username@host 'bash -s' < my.sh helloworld

通过ssh可以远程执行远程主机上的脚本,如 ssh username@host /home/nick/test.sh arg1 arg2 注意,此时需要指定脚本的绝对路径!

SSH的config文件

在个人主目录下的.ssh子目录中的config文件。示例:

# configuration 1
Host cluster
	HostName 192.168.11.11
	User tom

# configuration 2
Host=aliyun
	Hostname=202.44.2.2
	User tom

每项配置都是参数名 参数值参数值=参数名两种形式,可以混用。参数名不区分大小写,参数值区分大小写。

  • Host 主机的昵称。可用于在ssh命令行中代替 username@ip_address
  • HostName 主机IP地址或主机名
  • User ssh登录时使用的用户名
  • IdentityFile 认证证书文件,默认位置是~/.ssh/id_rsa~/ssh/id_dsa等,如果采用默认的证书,可以不用设置此参数,除非证书放在某个自定义的目录,那么就需要设置该参数来指向该证书
  • Port SSH访问主机的端口号,默认是22端口

另请参阅

参考文献

  1. ^ 1.0 1.1 release-9.7. 
  2. ^ OpenSSH Portable Release. OpenBSD. [15 October 2015]. (原始内容存档于2018-02-16). 
  3. ^ Specifications implemented by OpenSSH. The OpenBSD Project. The OpenBSD Project. [14 October 2015]. (原始内容存档于2018-01-25). 

外部連結

OpenBSD计划
操作系统
  • OpenBSD
    • 时间线英语Timeline of OpenBSD
    • 安全英语OpenBSD security features
相关计划
  • CARP
  • LibreSSL
  • OpenSSH
  • OpenBGPD
  • OpenIKED英语OpenIKED
  • OpenOSPFD
  • OpenNTPD
  • OpenSMTPD英语OpenSMTPD
  • PF英语PF (firewall)
  • sndio英语sndio
  • spamd英语spamd
  • Systrace英语Systrace
  • Tmux
  • Xenocara英语Xenocara
  • W^X英语W^X
人物
资源
  • OpenBSD Journal英语OpenBSD Journal
加密軟體英语Encryption software
電子郵件用戶端
安全通信英语Secure communication
OTR
  • Adium
  • BitlBee英语BitlBee
  • Centericq英语Centericq
  • ChatSecure
  • climm英语climm
  • Jitsi
  • Kopete
  • MCabber英语MCabber
  • Profanity英语Profanity (instant messaging client)
SSH
TLS & SSL(比较)
VPN
ZRTP英语ZRTP
  • CSipSimple英语CSipSimple
  • Jitsi
  • Linphone
  • Jami
  • Zfone英语Zfone
P2P
DRA
磁盘加密(比较英语Comparison of disk encryption software)
  • BestCrypt英语BestCrypt
  • BitLocker
  • CrossCrypt英语CrossCrypt
  • Cryptoloop英语Cryptoloop
  • DiskCryptor英语DiskCryptor
  • dm-crypt
  • DriveSentry英语DriveSentry
  • E4M英语E4M
  • ECryptfs
  • FileVault
  • FreeOTFE英语FreeOTFE
  • GBDE英语GBDE
  • geli英语geli (software)
  • LUKS
  • PGPDisk英语PGPDisk
  • Private Disk英语Private Disk
  • Scramdisk英语Scramdisk
  • Sentry 2020英语Sentry 2020
  • TrueCrypt
    • 历史英语TrueCrypt version history
  • VeraCrypt
匿名软件
文件系统 (列表英语List of cryptographic file systems)
  • EncFS
  • EFS
  • ECryptfs
  • LUKS英语Linux Unified Key Setup
  • PEFS英语PEFS
  • Rubberhose英语Rubberhose (file system)
  • StegFS英语StegFS
  • Tahoe-LAFS英语Tahoe-LAFS
安全聚焦作業系統英语Security-focused operating system
  • Tails
服務供應商
  • 自由网
  • Tresorit英语Tresorit
  • Wuala英语Wuala
教学
  • CrypTool英语CrypTool
相关主题
  • 分类 分类
  • 共享资源页面 共享资源
常见概念与条目
自由软件及其定義其他称谓英语Alternative terms for free software · 與封閉原始碼的比較英语Comparison of open source and closed source · 开源软件及其开发英语Open-source software development · 自由软件托管服务比较 · 自由软件项目列表英语List of free software project directories软件列表 · “免费”与“自由”的差别英语Gratis versus libre · 長期支援 · 自由软件大纲英语Outline of free software
操作系统(内核)
AROS Research Operating System英语AROS · BSD · Darwin · FreeDOS · GNU Hurd · Haiku · Inferno · Linux · Mach · Minix · OpenSolaris · Plan 9 · ReactOS · Symbian
软件列表
软件开发英语Comparison of open-source programming language licensing · 生物信息学英语List of open-source bioinformatics software · 数学英语List of open-source software for mathematics · 文字处理软件 · 音频英语Comparison of free software for audio · 商业软件英语List of commercial open-source applications and services
歷史与运动
GNU · Haiku · Linux · Mozilla (Application Suite · Firefox · Thunderbird) · 自由软件运动 · 开源软件运动英语Open-source software movement · 大事记英语List of free-software events
组织英语List of free and open-source software organizations社群
許可證
类型与标准
挑戰
FUD · 擁抱、擴充功能再消滅 · 二進制blob · 数字版权管理 · 自由及開放原始碼顯示卡驅動程式英语Free and open-source graphics device driver · 授權擴散英语License proliferation  · Mozilla 软件品牌重塑英语Mozilla Corporation software rebranded by the Debian project · 專有軟體 · SCO-Linux爭議 · 安全性 · 軟體專利 · 硬體限制 · 可信计算 · 对 GPL 的有关批评
其他
Linux發行版 · 分叉 (软件开发) · 微軟開放規範承諾英语Microsoft Open Specification Promise · 共享原始碼 ·操作系统革命
分类 分类 · 共享资源页面 维基共享资源 · 主题 主题