Coding Cat Coding Cat
首页
  • 剑指 Offer
  • LeetCode
  • 算法与数据结构
  • Python 语言
  • Web 开发
  • 数据分析
  • Spark
  • Hive
  • Elastic Search
  • 机器学习
  • NLP
  • 智能风控
  • Linux
  • 工具
  • macOS
  • 博客进化记
  • 杂谈
GitHub (opens new window)
首页
  • 剑指 Offer
  • LeetCode
  • 算法与数据结构
  • Python 语言
  • Web 开发
  • 数据分析
  • Spark
  • Hive
  • Elastic Search
  • 机器学习
  • NLP
  • 智能风控
  • Linux
  • 工具
  • macOS
  • 博客进化记
  • 杂谈
GitHub (opens new window)
  • Linux

    • Linux 文件切分与合并
    • Ubuntu16安装搜狗输入法
    • 服务器自建SSR过程笔记
    • Ubuntu 16.04 配置 tensorflow-gpu 计算环境
    • linux后台运行程序
    • 迁移服务器的一些记录
    • Linux 统计文件夹内文件的个数
    • Ubuntu配置终端使用代理
  • 工具

    • Git 常用命令速查
    • 在Vmware虚拟机上搭建Hadoop+Spark集群
    • iTerm2 配置 ssh 记住密码一键登录
    • 使用frp进行内网穿透
  • Linux
  • 工具
anthony
2018-10-27

iTerm2 配置 ssh 记住密码一键登录

首先,切换到ssh目录下,并新建脚本文件。

cd ~/.ssh/
touch file1
1
2

在文件中输入下面的内容:

set user "你的用户名"
set host "你的服务器地址"
set password "你的密码"
set port 22  # 你的端口号,默认22

spawn ssh $user@$host -p $port
expect "*assword:*"
send "$password\r"
interact
expect eof
1
2
3
4
5
6
7
8
9
10

然后打开 iTerm2,菜单 Profiles - Open Profiles - Edit Profiles,新建一个 Profile,在Command处输入

expect ~/.ssh/file1
1

这时在菜单 Profiles 中,就能看到新建的这个 Profile 了,鼠标点一下,即可执行,完成远程登录。

注:首次登录时,会提示是否信任密钥,需要手动输入 yes,然后再连一次,之后的登录就不需要了。

上次更新: 2020/09/19, 14:09:00
在Vmware虚拟机上搭建Hadoop+Spark集群
使用frp进行内网穿透

← 在Vmware虚拟机上搭建Hadoop+Spark集群 使用frp进行内网穿透→

Theme by Vdoing | Copyright © 1994-2021 anthony 京 ICP 备 17072417-1
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式