Move2SSH is a handy script for working with .ssh
directories. It allows you to copy, move, and manage files inside .ssh
with automatic Git configuration updates.
brew tap KITONK/tap
brew install move2ssh
If after installation, the move2ssh command is not found, follow these steps:
-
Create a symbolic link to ensure the move2ssh command works:
sudo ln -s /opt/homebrew/Cellar/move2ssh/1.2.0/bin/move2ssh.sh /usr/local/bin/move2ssh
-
After creating the symbolic link, you can use the move2ssh command:
move2ssh --h
or
move2ssh --help
~/.ssh/ ├── personal/ │ ├── id_rsa │ ├── id_rsa.pub │ └── gitconfig ├── work/ │ ├── id_rsa │ ├── id_rsa.pub │ └── gitconfig └── ...
move2ssh [source_folder] [--m|--move] [--h|--help] [--l|--list] [--b|--backup]
source_folder
— name of the folder with files to copy.--m | --move
— move existing files to a new folder before copying from source folder.--h | --help
— show help message.--l | --list
— show list of all directories inside .ssh.--b | --backup
- create a backup of current .ssh files before replacing them.
Each SSH configuration folder can contain a gitconfig
file with the following format:
user.name=John Doe
user.email=[email protected]
✅ Copy files from personal
to .ssh
and update Git config
move2ssh personal
✅ Move existing files to a new folder before copying from source folder
move2ssh work --m
or
move2ssh work --move
✅ Show list of available directories
move2ssh --l
or
move2ssh --list
✅ Show help message
move2ssh --h
or
move2ssh --help
✅ Create a backup of current .ssh files before replacing them
move2ssh --b
or
move2ssh --backup
Move2SSH supports command completion in various shells:
- Zsh
- Bash
- Fish
- PowerShell
- WSL
- Git Bash
Tab completion works for both folder names and options:
move2ssh [TAB] # Shows available configurations
move2ssh -[TAB] # Shows available options
- macOS (Bash, Zsh)
- Linux (Bash, Zsh)
- Windows Subsystem for Linux (WSL)
- Git Bash
- PowerShell
brew upgrade move2ssh
brew uninstall move2ssh
-
Clone the repository:
git clone https://github.com/KITONK/move2ssh.git cd move2ssh
-
Project structure:
move2ssh/ ├── bin/ │ └── move2ssh ├── completions/ │ ├── bash/ │ ├── fish/ │ ├── powershell/ │ └── zsh/ └── Formula/
-
Make the script executable:
chmod +x bin/move2ssh
-
Run the script:
./bin/move2ssh personal
- Automatically sets correct permissions (700 for .ssh, 600 for private keys)
- Creates backups when using --backup
- Safe file movement with --move option
This project is licensed under the MIT License.