debian 打开ssh服务


 
debian 打开ssh服务

在Debian系统中,您可以通过以下步骤开启SSH服务(Secure Shell):

  1. 安装OpenSSH服务器软件包:

sudo apt update
 
sudo apt install openssh-server
  1. 启动SSH服务:

sudo systemctl start ssh
 
  1. 使SSH服务在系统启动时自动运行: 

sudo systemctl enable ssh
 

安装完成以后,可以通过以下命令看到它们运行的进程:

ps -e |grep ssh

#输出:
777? 00:00:00 ssh-agent
#表示客户端已运行;
41253 ? 00:00:00 sshd #表示服务端已运行;
 

允许root用户ssh连接
我自己的修改为:增加了 root登录的权限。
修改/etc/ssh/sshd_config

# 修改前
PermitRootLogin without-password
# 修改后
PermitRootLogin yes

然后重启ssh服务
修改后以后,我们需要重新启动服务:

#方法一:
/etc/init.d/ssh restart

# 方法二:
service ssh restart

posted on 2024-03-21 23:19  zxddesk  阅读(300)  评论(0编辑  收藏  举报

导航