博客
关于我
Mac实现远程服务器登录管理
阅读量:796 次
发布时间:2023-02-06

本文共 929 字,大约阅读时间需要 3 分钟。

在MAC上使用xshell类似终端工具时,可能会遇到一些不便之处。虽然MAC的终端命令功能强大,但对于日常管理工作,手动输入服务器IP和密码确实有些繁琐。为了解决这个问题,我尝试使用SSH密码管理工具sshpass来实现自动化管理。

首先,安装sshpass时遇到了一些问题。系统提示缺少必要的编译工具,提示信息显示xcrun: error: invalid active developer path。经过查阅资料,发现是由于Xcode安装过程中出现了问题。为了解决这个问题,我按照以下步骤操作:

  • 安装必要的编译工具:首先,我需要确保系统中有足够的编译工具。通过终端输入以下命令:

    xcode-select --install

    这将为系统下载并安装必要的命令行工具,解决了xcrun错误。

  • 安装gcc:安装完Xcode后,重新尝试安装gcc:

    brew install gcc

    安装过程中,依次下载并安装了gmpislmpfrlibmpc等依赖项,最终成功安装了gcc

  • 安装sshpass:接着,按照文档指引,从源码安装sshpass

    brew install https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Formula/sshpass.rb

    或者直接从官方仓库下载并编译:

    wget https://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gztar -xzf sshpass-1.06.tar.gzcd sshpass-1.06make install
  • 使用sshpass管理SSH密码:安装完成后,可以通过以下方式调用sshpass

    sshpass -f 
    ssh username@server

    这样可以自动读取密码文件,实现SSH密码管理的自动化。

  • 通过以上步骤,我成功实现了在MAC上使用sshpass来管理SSH密码,避免了频繁手动输入的麻烦。对于类似问题,可以参考相关技术博客和官方文档,确保安装过程顺利进行。

    转载地址:http://iqufk.baihongyu.com/

    你可能感兴趣的文章
    NMF(非负矩阵分解)
    查看>>
    nmon_x86_64_centos7工具如何使用
    查看>>
    NN&DL4.1 Deep L-layer neural network简介
    查看>>
    NN&DL4.3 Getting your matrix dimensions right
    查看>>
    NN&DL4.7 Parameters vs Hyperparameters
    查看>>
    NN&DL4.8 What does this have to do with the brain?
    查看>>
    nnU-Net 终极指南
    查看>>
    No 'Access-Control-Allow-Origin' header is present on the requested resource.
    查看>>
    No 'Access-Control-Allow-Origin' header is present on the requested resource.
    查看>>
    NO 157 去掉禅道访问地址中的zentao
    查看>>
    no available service ‘default‘ found, please make sure registry config corre seata
    查看>>
    No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
    查看>>
    no connection could be made because the target machine actively refused it.问题解决
    查看>>
    No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
    查看>>
    No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
    查看>>
    No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
    查看>>
    No mapping found for HTTP request with URI [/...] in DispatcherServlet with name ...的解决方法
    查看>>
    No mapping found for HTTP request with URI [/logout.do] in DispatcherServlet with name 'springmvc'
    查看>>
    No module named 'crispy_forms'等使用pycharm开发
    查看>>
    No module named 'pandads'
    查看>>