所有数据默认保存在 $HOME/.atsh.d,数据迁移时候整个目录拷贝即可
╰─ tree ~/.atsh.d
~/.atsh.d
├── atsh # autossh.exe / atsh.exe in windows
└── .atsh.d # atsh data
├── atsh.db # records database
├── id_rsa # ssh private key
├── id_rsa.pub # ssh public key
├── config.toml # config file with little information
└── logs # log directory
└── 2025-07-21.json命令行工具
桌面应用(demo)
如果想指定登录密钥,将密钥路径写入配置文件 config.toml 即可
[sshkey]
private = "/home/to/.ssh/id_rsa"
public = "/home/to/.ssh/id_rsa.pub"可按照如下操作使用无密码登录:
> atsh ssh-keygen
INFO 🔑 Starting generating rsa key pair...
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
...输入密码为空(回车)即可,但请妥善保护好你的私钥文件!
Download the pre-built binary directly from release
OR install by cargo
cargo install atsh/autosshOR build from source
git clone --depth=1 https://github.com/idhyt/autossh
cd autossh && cargo build --releaseOR cross build for other platform
╰─ ./xbuild
1) x86_64-unknown-linux-musl
2) aarch64-unknown-linux-musl
3) x86_64-apple-darwin
4) aarch64-apple-darwin
5) x86_64-pc-windows-gnu
Select the target platform number:More details see --help
该命令需要强制添加环境变量 ATSH_KEY 用于加密存储密码。
❯ atsh add -u idhyt -p password -i 1.2.3.4 -n ubuntu
+-------+--------+-------+---------+------+
| index | name | user | ip | port |
+=======+========+=======+=========+======+
| 1 | ubuntu | idhyt | 1.2.3.4 | 22 |
+-------+--------+-------+---------+------+add other server info by -N/--note option, like -N "expired at 2022-11-11"
note! the password need to be escaped if there are special characters in it. you can refer to the following which-characters-need-to-be-escaped-when-using-bash
该命令仅在第一次执行时需要 ATSH_KEY 环境变量做认证,后续则不再需要。
❯ atsh login -i 1
(idhyt@1.2.3.4) Password:
Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-156-generic x86_64)authorize again by --auth option, useful when the password is changed or copied to another machine
❯ atsh rm -i 1
+-------+------+------+----+------+
| index | name | user | ip | port |
+-------+------+------+----+------+remove multiple records by rm -i 1 2 3 ...
❯ atsh ls
+-------+--------+-------+---------+------+
| index | name | user | ip | port |
+=======+========+=======+=========+======+
| 1 | ubuntu | idhyt | 1.2.3.4 | 22 |
+-------+--------+-------+---------+------+❯ atsh ls --all
+-------+--------+-------+---------+------+----------+
| index | name | user | ip | port | password |
+=======+========+=======+=========+======+==========+
| 1 | ubuntu | idhyt | 1.2.3.4 | 22 | password |
+-------+--------+-------+---------+------+----------+❯ atsh upload -i 1 -p ./test.txt /tmp/test.txt
❯ atsh download -i 1 -p /tmp/test.txt ./test.txt- 通过
ssh-keygen生成密钥对 - 优化和重构部分实现
- 更新部分依赖
- 默认数据目录为 $HOME/.atsh.d
- 降级 edition 为 2021 以支持低版本
- 更新 cross 编译工具链到最新版本
- 优化和重构,将存储方式改为数据库
- 使用
upload/download功能替换scp功能 - 环境变量改为
ATSH_KEY( 暂时兼容ASKEY) - 编译的可执行文件从
autossh改为atsh
使用 tool.py 可将早期版本(<=0.3.2>)的数据迁移到数据库中,请执行以下命令:
mkdir -p ~/.atsh.d
python tool.py toml2db -i ~/.config/autossh/config.toml -o ~/.atsh.d- 增加 scp 功能(文件/目录)
如果path1存在,则认为是从本地拷贝到远程服务器path2,反之则是从远程服务器拷贝到本地。
- 使用标准的免密登录方式(更安全)
- 强制加密 (确保设置了
ASKEY环境变量,仅认证过程需要) - 在 win 和 unix 系统下行为保持一致性
- 部分重构
- 支持插件模块
- windows 支持
- 编译优化和提示
- 支持一次删除多个记录
- 支持增加备注信息
- 添加、删除、查看、免密登录

