Skip to content

Move2SSH is a simple script for managing .ssh directories. It allows you to copy or move files into .ssh easily.

License

Notifications You must be signed in to change notification settings

KITONK/move2ssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Move2SSH

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.

📥 Installation via Homebrew

brew tap KITONK/tap
brew install move2ssh

⚠️ Homebrew Installation Fix

If after installation, the move2ssh command is not found, follow these steps:

  1. 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
  2. After creating the symbolic link, you can use the move2ssh command:

    move2ssh --h

    or

    move2ssh --help

📁 Directory Structure

~/.ssh/ ├── personal/ │ ├── id_rsa │ ├── id_rsa.pub │ └── gitconfig ├── work/ │ ├── id_rsa │ ├── id_rsa.pub │ └── gitconfig └── ...

🚀 Usage

move2ssh [source_folder] [--m|--move] [--h|--help] [--l|--list] [--b|--backup]

🔹 Arguments:

  • 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.

🔄 Git Configuration

Each SSH configuration folder can contain a gitconfig file with the following format: user.name=John Doe user.email=[email protected]

📌 Examples

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

🔤 Shell Completion

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

💻 Supported Environments

  • macOS (Bash, Zsh)
  • Linux (Bash, Zsh)
  • Windows Subsystem for Linux (WSL)
  • Git Bash
  • PowerShell

🔄 Update

brew upgrade move2ssh

❌ Uninstall

brew uninstall move2ssh

🛠 Development

  1. Clone the repository:

    git clone https://github.com/KITONK/move2ssh.git
    cd move2ssh
  2. Project structure:

    move2ssh/
    ├── bin/
    │   └── move2ssh
    ├── completions/
    │   ├── bash/
    │   ├── fish/
    │   ├── powershell/
    │   └── zsh/
    └── Formula/
    
  3. Make the script executable:

    chmod +x bin/move2ssh
  4. Run the script:

    ./bin/move2ssh personal

🔒 Security Features

  • Automatically sets correct permissions (700 for .ssh, 600 for private keys)
  • Creates backups when using --backup
  • Safe file movement with --move option

📜 License

This project is licensed under the MIT License.


💡 Author: KITO
🚀 GitHub: Move2SSH

About

Move2SSH is a simple script for managing .ssh directories. It allows you to copy or move files into .ssh easily.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •