Ubuntu-3-ubuntu开启ssh远程登录

26次阅读
没有评论

在Ubuntu上启用SSH以进行远程登录,您需要安装SSH服务器软件包,然后启动并启用SSH服务。以下是命令行步骤:

1 更新软件包列表:

sudo apt update

2 安装OpenSSH服务器软件包:

sudo apt install openssh-server

3 确认SSH服务已经启动:

sudo systemctl status ssh

4 如果SSH服务没有自动启动,您可以使用以下命令启动它:

sudo systemctl start ssh

5 要确保SSH服务在系统启动时自动启动,请使用以下命令:

sudo systemctl enable ssh

6 (可选)如果您需要修改SSH配置(例如更改默认端口或禁用root登录),编辑 /etc/ssh/sshd_config 文件:

sudo nano /etc/ssh/sshd_config

7 做出更改后,保存文件并重启SSH服务以应用更改:

sudo systemctl restart ssh

8 现在,您应该可以从远程客户端使用SSH来连接Ubuntu系统了。使用以下命令(将<user>替换为您的Ubuntu用户名,将<ip-address>替换为Ubuntu机器的IP地址):

ssh <user>@<ip-address>

正文完
 0
bdspAdmin
版权声明:本站原创文章,由 bdspAdmin 于2025-10-30发表,共计512字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)