在Ubuntu系统上,需先安装OpenSSH Server以支持SSH连接。操作步骤如下:
sudo apt-get update && sudo apt-get install openssh-server
sudo systemctl start ssh && sudo systemctl enable ssh
sudo systemctl status ssh
ip a # 或使用 ifconfig(需安装net-tools包)
打开SecureCRT,按以下步骤创建会话:
SSH2
(推荐,安全性更高);192.168.1.100
);22
(若Ubuntu的SSH端口有修改,需保持一致);ubuntu
或你的自定义用户名);UTF-8
,点击OK。sudo systemctl status ssh
);sudo ufw allow 22
开启22端口);密钥认证替代密码认证,步骤如下:
~/.ssh/id_rsa
):ssh-keygen -t rsa -b 4096
ssh-copy-id
命令将公钥复制到Ubuntu服务器的~/.ssh/authorized_keys
文件中:ssh-copy-id username@your_server_ip
输入Ubuntu用户密码后,公钥将自动添加到授权文件中。Public key authentication
;id_rsa
),点击OK保存。若需通过SecureCRT访问Ubuntu服务器上的其他服务(如Web、数据库),可配置SSH隧道:
8080
,用于本地访问);localhost:80
,表示转发到Ubuntu的80端口);localhost:8080
即可访问Ubuntu服务器上的80端口服务(如Web页面)。以上步骤覆盖了SecureCRT连接Ubuntu的基础与高级需求,可根据实际场景选择配置。若遇到问题,优先检查SSH服务状态、网络连通性及防火墙设置。