温馨提示×

ubuntu怎样使用fetchlinux

小樊
52
2025-09-07 01:56:27
栏目: 智能运维

安装FetchLinux

  1. 使用包管理器安装(推荐):
    sudo apt update
    sudo apt install fetchlinux
    
  2. 手动安装(若需特定版本):
    • GitHub仓库下载二进制文件,赋予执行权限后移动到/usr/local/bin
      wget https://github.com/fetchlinux/fetch/releases/download/v1.0.0/fetchlinux-linux-amd64 -O fetchlinux
      chmod +x fetchlinux
      sudo mv fetchlinux /usr/local/bin/
      

基本用法

  • 查看帮助
    fetchlinux --help
    
  • 下载文件/目录
    • 单个文件:
      fetchlinux user@remote_host:/path/to/remote/file /local/path
      
    • 整个目录(递归):
      fetchlinux user@remote_host:/path/to/remote/dir /local/path -r
      
  • 上传文件/目录
    • 单个文件:
      fetchlinux -u user@remote_host /local/path/file /path/to/remote
      
    • 整个目录:
      fetchlinux -u user@remote_host /local/path/dir -r /path/to/remote
      

高级选项

  • SSH密钥认证
    fetchlinux -i /path/to/private_key user@remote_host
    
  • 指定SSH端口
    fetchlinux user@remote_host -p 2222
    
  • 使用代理
    fetchlinux user@remote_host -x http://proxy_host:proxy_port
    

注意事项

  • 确保本地有SSH密钥对,并将公钥添加到远程服务器的~/.ssh/authorized_keys(若使用密钥认证)。
  • 操作前确认远程路径权限,避免误删或覆盖重要文件。

更多详细用法可参考FetchLinux官方文档

0