solaris58安装ssh
-
下载ssh安装包,可以从OpenSSH官方网站下载,也可以从Solaris官方网站下载。下载后将安装包放在合适的位置。
-
在Solaris系统上安装必要的软件包,包括gcc、make和openssl。可以使用pkgadd命令进行安装。
-
在安装目录中解压缩ssh安装包,使用tar命令进行解压缩。例如:
tar -zxvf openssh-7.2p2.tar.gz
-
进入解压缩后的目录,执行configure命令进行配置。例如:
./configure --prefix=/usr/local/openssh --with-ssl-dir=/usr/local/ssl
--prefix选项指定ssh安装目录,--with-ssl-dir选项指定openssl安装目录。
-
执行make命令进行编译。例如:
make
-
执行make install命令进行安装。例如:
make install
-
在/etc/ssh目录下创建ssh_host_key和ssh_host_rsa_key文件,使用ssh-keygen命令进行生成。例如:
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
-
修改sshd配置文件/etc/ssh/sshd_config,启用SSH服务并进行必要的配置。例如:
Port 22 Protocol 2 PermitRootLogin no PasswordAuthentication yes UsePAM yes
Port选项指定SSH服务使用的端口号,Protocol选项指定使用SSH协议版本2,PermitRootLogin选项指定是否允许root用户登录,PasswordAuthentication选项指定是否使用密码进行身份验证,UsePAM选项指定是否使用PAM进行身份验证。
-
启动SSH服务,可以使用svcadm命令进行启动。例如:
svcadm enable ssh
启动后可以使用ssh命令进行远程登录。例如:
ssh username@hostname
其中username为远程登录用户名,hostname为远程主机名或IP地址
原文地址: https://www.cveoy.top/t/topic/haGp 著作权归作者所有。请勿转载和采集!