diff --git a/docs/configs/docsdev.js b/docs/configs/docsdev.js
index 690d9ce883..1196850b5e 100644
--- a/docs/configs/docsdev.js
+++ b/docs/configs/docsdev.js
@@ -221,6 +221,10 @@ export default {
title: 'Apache Linkis',
link: '/en-us/docs/dev/user_doc/guide/task/linkis.html',
},
+ {
+ title: 'SSH',
+ link: '/en-us/docs/dev/user_doc/guide/task/ssh.html',
+ },
],
},
{
@@ -319,6 +323,10 @@ export default {
title: 'OceanBase',
link: '/en-us/docs/dev/user_doc/guide/datasource/oceanbase.html',
},
+ {
+ title: 'SSH',
+ link: '/en-us/docs/dev/user_doc/guide/datasource/ssh.html',
+ },
],
},
{
@@ -906,6 +914,10 @@ export default {
title: 'Apache Linkis',
link: '/zh-cn/docs/dev/user_doc/guide/task/linkis.html',
},
+ {
+ title: 'SSH',
+ link: '/zh-cn/docs/dev/user_doc/guide/task/ssh.html',
+ },
],
},
{
@@ -988,6 +1000,10 @@ export default {
title: 'OceanBase',
link: '/zh-cn/docs/dev/user_doc/guide/datasource/oceanbase.html',
},
+ {
+ title: 'SSH',
+ link: '/zh-cn/docs/dev/user_doc/guide/datasource/ssh.html',
+ },
],
},
{
diff --git a/docs/docs/en/guide/datasource/ssh.md b/docs/docs/en/guide/datasource/ssh.md
new file mode 100644
index 0000000000..0850ca1c18
--- /dev/null
+++ b/docs/docs/en/guide/datasource/ssh.md
@@ -0,0 +1,15 @@
+# SSH Data Source
+
+This data source is used for RemoteShell component to execute commands remotely.
+
+![sh](../../../../img/new_ui/dev/datasource/ssh.png)
+
+- Data Source: SSH
+- Data Source Name: Enter the name of the data source
+- Description: Enter the description of the data source
+- IP Hostname: Enter the IP to connect to SSH
+- Port: Enter the port to connect to SSH
+- Username: Set the username to connect to SSH
+- Password: Set the password to connect to SSH
+- Public Key: Set the public key to connect to SSH
+
diff --git a/docs/docs/en/guide/task/remoteshell.md b/docs/docs/en/guide/task/remoteshell.md
new file mode 100644
index 0000000000..0286e2f825
--- /dev/null
+++ b/docs/docs/en/guide/task/remoteshell.md
@@ -0,0 +1,31 @@
+# RemoteShell
+
+## Overview
+
+RemoteShell task type is used to execute commands on remote servers.
+
+## Create Task
+
+- Click Project Management-Project Name-Workflow Definition, click the "Create Workflow" button to enter the DAG editing page.
+
+- Drag from the toolbar to the canvas to complete the creation.
+
+## Task Parameters
+
+[//]: # (TODO: use the commented anchor below once our website template supports this syntax)
+[//]: # (- Please refer to [DolphinScheduler Task Parameters Appendix](appendix.md#default-task-parameters) `Default Task Parameters` section for default parameters.)
+
+- Please refer to [DolphinScheduler Task Parameters Appendix](appendix.md) `Default Task Parameters` section for default parameters.
+- SSH Data Source: Select SSH data source.
+
+## Task Example
+
+### View the path of the remote server (remote-server)
+
+![remote-shell-demo](../../../../img/tasks/demo/remote-shell.png)
+
+## Precautions
+
+After the task connects to the server, it will not automatically source bashrc and other files. The required environment variables can be imported in the following ways
+- Create environment variables in the security center-Environment Management, and then import them through the environment option in the task definition
+- Enter the corresponding environment variables directly in the script
diff --git a/docs/docs/zh/guide/datasource/ssh.md b/docs/docs/zh/guide/datasource/ssh.md
new file mode 100644
index 0000000000..f6f6f220f9
--- /dev/null
+++ b/docs/docs/zh/guide/datasource/ssh.md
@@ -0,0 +1,15 @@
+# SSH 数据源
+
+该数据源用于RemoteShell组件,用于远程执行命令。
+
+![sh](../../../../img/new_ui/dev/datasource/ssh.png)
+
+- 数据源:选择 SSH
+- 数据源名称:输入数据源的名称
+- 描述:输入数据源的描述
+- IP 主机名:输入连接 SSH 的 IP
+- 端口:输入连接 SSH 的端口
+- 用户名:设置连接 SSH 的用户名
+- 密码:设置连接 SSH 的密码
+- 公钥:设置连接 SSH 的公钥
+
diff --git a/docs/docs/zh/guide/task/remoteshell.md b/docs/docs/zh/guide/task/remoteshell.md
new file mode 100644
index 0000000000..67735dca63
--- /dev/null
+++ b/docs/docs/zh/guide/task/remoteshell.md
@@ -0,0 +1,30 @@
+# RemoteShell
+
+## 综述
+
+RemoteShell 任务类型,用于在远程服务器上执行命令。
+
+## 创建任务
+
+- 点击项目管理-项目名称-工作流定义,点击"创建工作流"按钮,进入 DAG 编辑页面。
+- 工具栏中拖动 到画板中,即可完成创建。
+
+## 任务参数
+
+[//]: # (TODO: use the commented anchor below once our website template supports this syntax)
+[//]: # (- 默认参数说明请参考[DolphinScheduler任务参数附录](appendix.md#默认任务参数)`默认任务参数`一栏。)
+
+- 默认参数说明请参考[DolphinScheduler任务参数附录](appendix.md)`默认任务参数`一栏。
+- SSH Data Source: 选择SSH 数据源。
+
+## 任务样例
+
+### 查看远程服务器(remote-server)的路径
+
+![remote-shell-demo](../../../../img/tasks/demo/remote-shell.png)
+
+## 注意事项
+
+该任务连接服务器后,不会自动source bashrc等文件,所需的环境变量,可以通过以下方式导入
+- 在安全中心-环境管理中创建环境变量,然后通过任务定义中的环境选项引入
+- 在脚本中直接输入对应的环境变量
diff --git a/docs/img/new_ui/dev/datasource/ssh.png b/docs/img/new_ui/dev/datasource/ssh.png
new file mode 100644
index 0000000000..e29d231bdd
Binary files /dev/null and b/docs/img/new_ui/dev/datasource/ssh.png differ
diff --git a/docs/img/tasks/demo/remote-shell.png b/docs/img/tasks/demo/remote-shell.png
new file mode 100644
index 0000000000..a5e6773acb
Binary files /dev/null and b/docs/img/tasks/demo/remote-shell.png differ
diff --git a/docs/img/tasks/icons/remoteshell.png b/docs/img/tasks/icons/remoteshell.png
new file mode 100644
index 0000000000..4e40b6eb20
Binary files /dev/null and b/docs/img/tasks/icons/remoteshell.png differ
diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java
index 6f5c8e5eca..fc39e1b72d 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java
+++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java
@@ -35,6 +35,7 @@ import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.DataSourceMapper;
import org.apache.dolphinscheduler.dao.mapper.DataSourceUserMapper;
import org.apache.dolphinscheduler.plugin.datasource.api.datasource.BaseDataSourceParamDTO;
+import org.apache.dolphinscheduler.plugin.datasource.api.datasource.DataSourceProcessor;
import org.apache.dolphinscheduler.plugin.datasource.api.plugin.DataSourceClientProvider;
import org.apache.dolphinscheduler.plugin.datasource.api.utils.DataSourceUtils;
import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;
@@ -186,9 +187,10 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource
return result;
}
// check password,if the password is not updated, set to the old password.
- BaseConnectionParam connectionParam =
- (BaseConnectionParam) DataSourceUtils.buildConnectionParams(dataSourceParam);
+ ConnectionParam connectionParam = DataSourceUtils.buildConnectionParams(dataSourceParam);
+
String password = connectionParam.getPassword();
+
if (StringUtils.isBlank(password)) {
String oldConnectionParams = dataSource.getConnectionParams();
ObjectNode oldParams = JSONUtils.parseObject(oldConnectionParams);
@@ -383,6 +385,15 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource
@Override
public Result