温馨提示×

debian如何配置securecrt

小樊
45
2026-10-25 08:14:30
栏目: 智能运维

下面按最常见场景说明:在 Debian 服务器端如何配置,以便用 SecureCRT 远程连接(SSH)。
SecureCRT 本身是 Windows / macOS 上的客户端,Debian 是服务端。


一、Debian 端基础配置(SSH 服务)

1. 安装 OpenSSH Server

sudo apt update
sudo apt install openssh-server

2. 启动并设置开机自启

sudo systemctl enable ssh
sudo systemctl start ssh

3. 确认 SSH 正在监听

sudo ss -tlnp | grep :22

或

sudo systemctl status ssh

二、创建普通用户(推荐)

不要直接用 root 登录:

sudo adduser yourname
sudo usermod -aG sudo yourname

三、SecureCRT 连接 Debian

1. 获取 Debian IP

ip a

通常是 192.168.x.x 或 10.x.x.x

2. SecureCRT 新建 Session

  • Protocol:SSH2
  • Hostname:Debian IP
  • Port:22
  • Username:你创建的用户名

连接后即可输入密码登录。


四、配置密钥登录(更安全,推荐)

1. 在 SecureCRT 生成密钥

Tools → Create Public Key

  • Type:RSA
  • Key length:2048 或 4096
  • 保存私钥(本地)
  • 复制 Public Key

2. 在 Debian 上配置

mkdir -p ~/.ssh
chmod 700 ~/.ssh
nano ~/.ssh/authorized_keys

粘贴公钥内容,然后:

chmod 600 ~/.ssh/authorized_keys

3. SecureCRT 使用密钥

Session → Properties → SSH2 → Authentication → 选 PublicKey


五、加强 SSH 安全(可选但推荐)

编辑配置文件:

sudo nano /etc/ssh/sshd_config

建议修改:

PermitRootLogin no
PasswordAuthentication no   # 仅密钥登录
Port 2222                  # 可改端口

修改后:

sudo systemctl restart ssh

⚠️ 改端口或禁密码前,确保密钥已可用


六、防火墙(如有)

sudo apt install ufw
sudo ufw allow 22
sudo ufw enable

七、常见问题

连不上?

  • IP 是否正确
  • SSH 是否运行
  • 虚拟机是否为桥接/NAT 端口映射
  • 防火墙是否放行

云服务器?

  • 需在安全组放行 22 端口

如果你说的是:

  • Debian 上运行 SecureCRT(Wine)
  • 串口连接(Serial)
  • Debian 作为跳板机

可以告诉我具体场景,我可以给你更针对性的配置。

0 踩