Skip to content
Eternal Center

Eternal Center

  • Single-Node (单节点)
    • System (系统)
    • Service (服务)
    • Database (数据库)
    • Container (容器)
    • Virtualization (虚拟化)
  • Multi-Node (多节点)
    • Cluster (集群)
    • Big Data (大数据)
    • Cloud Computing (云计算)
    • Batch Processing (批量处理)
  • Approach (方式方法)
    • Languages (语言)
    • Ideas (思路)
    • Programing (编程)
    • Project (项目)
  • Eternity (永恒)
    • News (消息)
    • Creations (创作)
    • Classics (经典)
    • Legends (传说)
    • Chronicle (编年史)
    • FNIOS (宇宙公民开源学院)
Posted on May 14, 2022July 9, 2023 by Mingyu Zhu

[工具] Shell 测试 SFTP 服务

  • 介绍
    • 基本信息
    • 使用方法
    • 脚本分割线里的变量
    • 注意
  • 脚本

介绍

基本信息

作者:朱明宇
名称:测试 SFTP 服务
作用:测试 SFTP 服务

使用方法

1. 在此脚本的分割线内写入相应的内容
2. 给此脚本添加执行权限
3. 执行此脚本

脚本分割线里的变量

IP=10.0.0.8 #要测试 SFTP 的服务器 IP 地址

注意

此脚本执行前必须要先保证执行脚本的主机能无秘钥远程需要测试 SFTP 服务的服务器

脚本

#!/bin/bash

####################### Separator ########################
IP=10.0.0.8
####################### Separator ########################

set timeout 3

rpm -q expect &> /dev/null
if [ $? -ne 0 ];then
        echo "Expect needs to be installed first"
fi

expect << EOF
spawn sftp $IP
expect "sftp>"                                   {send "cd /tmp\r" } 
expect "sftp>"                                   {send "ls -l\r"}
expect "sftp>"                                   {send "quit\r"}
expect ">"                                       {send "\r"}
EOF
CategoriesChinese Post (中文帖子), Programming (编程), Service (服务), SFTP, Shell, Shell Monitor (监控), Shell Tools (工具), Storage Service (存储服务), System (系统), System Login Security (系统登录安全), System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志), System Operation (系统操作), System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件), System Operation Tools (系统操作工具), System Security (系统安全)

Post navigation

Previous PostPrevious [内容] Rocky Linux 8 & RHEL 8 cockpit (Web Console) 的管理
Next PostNext [步骤] Linux 内存地址空间布局随机化的开启 (增加写入内存页漏洞的难度)

Aspiration (愿景):

Everyone can achieve self-achievement and self-happiness fairly

每个人都能公平地实现自我成就和自我幸福

Logo (徽标):

Additional Information (其他信息):

About     Manual     Clone     Contact
Disclaimer     Friendly Links     Donation

关于     手册     克隆     联系
免责声明     友情链接     捐赠

Search Inside Website (站内搜索)

Search Outside Website (站外搜索):

Google         Wikipedia         Bing

Eternal URL (永恒网址):

https://eternity.eternalcenter.com Will be last access method / 将是最后的访问方式

Proudly powered by LNMP Proudly powered by WordPress