catfee-ssh

SSH远程服务器密码连接技能。当用户提供服务器IP、用户名、密码需要SSH连接时激活。支持执行命令、查看配置、诊断问题、文件操作等运维操作。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "catfee-ssh" with this command: npx skills add glory904649854/catfee-ssh

Catfee SSH Skill

通过密码认证SSH连接远程服务器,执行运维操作。

前置要求

已安装 Posh-SSH 模块(首次使用时自动安装)。

连接模板

# 安装模块(如果未安装)
if (!(Get-Module -ListAvailable Posh-SSH)) {
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Scope CurrentUser
    Install-Module -Name Posh-SSH -Force -Scope CurrentUser -AllowClobber
}
Import-Module Posh-SSH

# 创建凭证并连接(用户提供:IP、用户名、密码)
$cred = New-Object System.Management.Automation.PSCredential("$username", (ConvertTo-SecureString "$password" -AsPlainText -Force))
$session = New-SSHSession -ComputerName "$ip" -Credential $cred -AcceptKey

# 执行命令
Invoke-SSHCommand -SessionId $session.SessionId -Command "command"

# 关闭连接
Remove-SSHSession -SessionId $session.SessionId

常用操作

查看系统信息

Invoke-SSHCommand -SessionId $session.SessionId -Command "hostname && uname -a && cat /etc/os-release"

查看服务状态

Invoke-SSHCommand -SessionId $session.SessionId -Command "systemctl status nginx"
Invoke-SSHCommand -SessionId $session.SessionId -Command "systemctl status docker"

查看文件

Invoke-SSHCommand -SessionId $session.SessionId -Command "cat /path/to/file"
Invoke-SSHCommand -SessionId $session.SessionId -Command "ls -la /path/to/dir"

查看日志

Invoke-SSHCommand -SessionId $session.SessionId -Command "tail -100 /var/log/nginx/error.log"
Invoke-SSHCommand -SessionId $session.SessionId -Command "journalctl -u nginx -n 100"

Nginx 诊断

Invoke-SSHCommand -SessionId $session.SessionId -Command "nginx -t 2>&1"
Invoke-SSHCommand -SessionId $session.SessionId -Command "cat /etc/nginx/nginx.conf"
Invoke-SSHCommand -SessionId $session.SessionId -Command "ls -la /etc/nginx/conf.d/"
Invoke-SSHCommand -SessionId $session.SessionId -Command "cat /etc/nginx/conf.d/*.conf"

Docker 操作

Invoke-SSHCommand -SessionId $session.SessionId -Command "docker ps -a"
Invoke-SSHCommand -SessionId $session.SessionId -Command "docker logs container_name --tail 100"
Invoke-SSHCommand -SessionId $session.SessionId -Command "docker-compose ps"

进程和端口

Invoke-SSHCommand -SessionId $session.SessionId -Command "ps aux | grep nginx"
Invoke-SSHCommand -SessionId $session.SessionId -Command "netstat -tlnp"
Invoke-SSHCommand -SessionId $session.SessionId -Command "ss -tlnp"

输出格式化

获取完整命令输出:

Invoke-SSHCommand -SessionId $session.SessionId -Command "command" | Select-Object -ExpandProperty Output | Out-String -Width 4000

会话保持

连续执行多个命令时保持同一个 session:

$session = New-SSHSession -ComputerName "$ip" -Credential $cred -AcceptKey
Invoke-SSHCommand -SessionId $session.SessionId -Command "cmd1"
Invoke-SSHCommand -SessionId $session.SessionId -Command "cmd2"
Invoke-SSHCommand -SessionId $session.SessionId -Command "cmd3"
Remove-SSHSession -SessionId $session.SessionId

执行修改操作

执行需要sudo权限的操作:

Invoke-SSHCommand -SessionId $session.SessionId -Command "sudo nginx -s reload"
Invoke-SSHCommand -SessionId $session.SessionId -Command "sudo systemctl restart docker"

安全注意

  • 每次使用用户提供的具体凭证,不存储凭证
  • 完成操作后关闭SSH会话
  • 不在日志或输出中暴露敏感信息

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Img2img

Generate images from text descriptions using DALL-E 3 while adhering to usage policies and avoiding realistic human faces.

Registry SourceRecently Updated
General

Habitat-GS-Navigator

Navigate and interact with photo-realistic 3DGS environments via the Habitat-GS Bridge. Use when: user asks to explore a 3D scene, perform embodied navigatio...

Registry SourceRecently Updated
General

Memory Palace

持久化记忆管理。Use when: 用户告诉你个人信息/偏好/习惯、需要记住项目状态/技术决策、完成任务后有可复用经验、用户说"记住""别忘了""下次注意"、需要回忆之前的对话内容。支持语义搜索和时间推理。

Registry SourceRecently Updated
General

Podcast Transcript Mining Authority Positioning

Extract guest appearances, speaking topics, and soundbites from podcast transcripts to build authority portfolios and generate podcast pitch templates. Use w...

Registry SourceRecently Updated