ubuntu 安装openssh服务器的教程详解
1.安装openssh 首先得安装 openssl 和zlib
安装openssl ---下载openssl-1.0.1j.tar.gz,解压到/usr/openssl/目录下进入解压目录 执行./config -fPIC 如下图
安装zlib---下载zlib-1.2.8.tar.gz解压到/usr/zlib/目录下
执行./configure make 和 make install命令 ok
2.下载openssh.tar.gz包解压放在/usr/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/目录下如图
开启ssh服务
注意要按照绝对路径开启ssh服务否则报错
查看ssh是否启动成功
通过putty连接服务器
打开
打开
连接登陆成功
通过ssh远程登陆
报错 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
重启sshd服务后,即可正常连接,如下图。
点击yes输入密码
点击ok
成功
设置 ssh开机启动,编辑/etc/rc.local文件
以上所述是小编给大家介绍的ubuntu 安装openssh服务器的教程详解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!
您可能感兴趣的文章:
- ubuntu安装vsftp服务器详解教程
- Ubuntu 服务器管理员手记(二):快速安装配置邮件服务器(详解 Postfix + Dovecot)
- 【教程】ubuntu下安装NFS服务器
- Ubuntu--服务器版本系统安装图解教程
- 在Ubuntu 16.04安装与使用Docker的教程详解
- Ubuntu 用vsftpd 配置FTP服务器教程详解
- macbook pro上安装三系统详解教程(mac os x+windows+linux ubuntu)
- ubuntu 13.10安装oracle sdk和PyCharm教程详解
- Ubuntu 14.04远程登录服务器--openssh的安装和配置简明步骤
- 阿里云Ubuntu服务器下载安装配置JDK,mysql,tomcat比较好的教程
- 在Ubuntu 14.04上安装搭建FTP服务器详解
- Ubuntu下安装JDK图文教程详解
- ubuntu 13.10安装oracle sdk和PyCharm教程详解
- Ubuntu 13.04 服务器版本系统安装图解教程
- Ubuntu 13.04 服务器版本系统安装图解教程
- #1045无法登录phpmyadmin,连接不上mysql服务器,先把ubuntu安装lamp教程贴上吧
- Ubuntu 13.04 服务器版本系统安装图解教程
- Ubuntu(-13.10)中安装JDK图文详解教程
- ubuntu 13.10安装oracle sdk和PyCharm教程详解
- ubuntu系统下安装pyspider:搭建pyspider服务器新手教程