ubuntu如何安装openssh服务器

发布时间:2022-10-20 11:21:55 作者:iii
来源:亿速云 阅读:544

这篇文章主要讲解了“ubuntu如何安装openssh服务器”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“ubuntu如何安装openssh服务器”吧!

1.安装openssh 首先得安装 openssl 和zlib

安装openssl ---下载openssl-1.0.1j.tar.gz,解压到/usr/openssl/目录下进入解压目录 执行./config -fpic 如下图

ubuntu如何安装openssh服务器

安装zlib---下载zlib-1.2.8.tar.gz解压到/usr/zlib/目录下

执行./configure make 和 make install命令 ok

2.下载openssh.tar.gz包解压放在/usr/openssh/目录下 解压 如图

ubuntu如何安装openssh服务器

执行 ./configure 之后部分编译如下 可以看到 openssh 的配置文件放在了 /usr/local/etc下注意 :一般情况下在/etc/ssh目录下

openssh has been configured with the following options:
user binaries: /usr/local/bin
system binaries: /usr/local/sbin
configuration files: /usr/local/etc
askpass program: /usr/local/libexec/ssh-askpass
manual pages: /usr/local/share/man/manx
pid file: /var/run
privilege separation chroot path: /var/empty

没有--with-ssl-dir=/usr/local/ssl可能会报 configure: error: openssl version header not found 执行make 和 make install 命令 报错:privilege separation user sshd does not exist 解决:在/etc/passwd 中加入: sshd:x:74:74:privilege-separatedssh:/var/empty/sshd:/sbin/nologin 再次make install 编译安装成功。

openssh 默认安装在/usr/local/sbin/目录下如图

ubuntu如何安装openssh服务器

开启ssh服务

ubuntu如何安装openssh服务器

注意要按照绝对路径开启ssh服务否则报错

查看ssh是否启动成功

ubuntu如何安装openssh服务器

通过putty连接服务器

ubuntu如何安装openssh服务器打开

ubuntu如何安装openssh服务器

打开

连接登陆成功

通过ssh远程登陆

ubuntu如何安装openssh服务器

ubuntu如何安装openssh服务器

报错 server responded "algorithm negotiation failed" 原因 客户端与服务端的压缩方式不一样

解决方法 修改ssh的配置文件一般在/etc/ssh/sshd_config 但是我这里是在/usr/local/etc/sshd_config下打死

在配置文件中添加:

ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc
macs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96
kexalgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org

ubuntu如何安装openssh服务器

重启sshd服务后,即可正常连接,如下图。

ubuntu如何安装openssh服务器ubuntu如何安装openssh服务器

点击yes输入密码

ubuntu如何安装openssh服务器

点击ok

ubuntu如何安装openssh服务器

成功

设置 ssh开机启动,编辑/etc/rc.local文件

ubuntu如何安装openssh服务器

  

感谢各位的阅读,以上就是“ubuntu如何安装openssh服务器”的内容了,经过本文的学习后,相信大家对ubuntu如何安装openssh服务器这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

推荐阅读:
  1. openssh 加固
  2. 在Ubuntu和LinuxMint上怎么安装和更新OpenSSH服务器

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

ubuntu openssh

上一篇:ubuntu下迅雷极速版如何安装与使用

下一篇:ubuntu下如何修改网卡名称

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》