本地计算机已下载并安装 WinSCP 客户端(获取途径:建议从 官方网站 获取最新版本)
ubuntu 服务器默认root是没有激活的,需要用安装系统的用户账号给root设置管理密码:
- 在控制台登录Ubuntu,输入
sudo passwd root
- 输入两遍密码后返回如下信息,即表示 root 密码设置成功。
passwd: password updated successfully
- 执行以下命令,打开 sshd_config 配置文件。
sudo vi /etc/ssh/sshd_config
-
按 i 切换至编辑模式,找到#Authentication,将PermitRootLogin without-password改为PermitRootLogin yes,并把该参数的注释去掉(#);找到# To disable tunneled clear text passwords, change to no here!将参数PermitEmptyPassword 、PasswordAuthentication 的注释去掉。
-
按 Esc,输入 :wq,保存文件并返回。
-
执行以下命令,重启 ssh 服务
sudo service ssh restart操作步骤 登录 WinSCP
- 打开 WinSCP,弹出“WinSCP 登录”对话框。如下图所示:
- 设置登录参数:
- 协议:选填 SFTP 或者 SCP 均可.
- 主机名:云服务器的公网 IP。
- 端口:默认为22。
- 用户名:Linux 实例默认管理员用户名为 root,Ubuntu 系统实例为 ubuntu。如果用户名填ubuntu的时候拒接连接可以试试填root(我用户名填root才能连接)
(使用远程登录软件登录 Linux 实例)



