I am archiving this project on GitHub as it deviated from the original plan of having a single-file program. I chose the wrong technology due to my limited knowledge and insufficient research. The current release of the program is still functional, but it includes an additional DLL file. I will not be fixing any bugs or adding new features to it.
In the future, I hope to develop an ssh-copy-id tool for Windows using Go, a language I am more comfortable with. However, this will depend on my availability. In fact, I already have a private project written in Go, but it is not yet complete.
Thank you. ๐ต๐ตโ๐ซ๐ฎโ๐จ
WinSSHCopyId is a Windows application developed in C# that provides an easy way to copy SSH public keys to a remote server. This tool is particularly useful for Windows users who lack the ssh-copy-id
utility.
- WinForm Interface: User-friendly graphical interface for easy SSH key management.
- CLI Mode: Command-line interface for advanced users.
- C# Language: Developed using C# for seamless integration with Windows.
- SSH Key Management: Automatically adds SSH public keys to the
authorized_keys
file on the remote server.
The motivation behind creating WinSSHCopyId is to provide Windows users with a simple and effective tool to manage SSH keys, similar to the ssh-copy-id
utility available on Unix-based systems.
- .NET Framework 4.8 or later
- Visual Studio 2019 or later
- Clone the repository:
git clone https://github.com/priesdelly/WinSSHCopyId.git
- Open the solution file
WinSSHCopyId.sln
in Visual Studio. - Build the solution to restore the NuGet packages and compile the project.
- Go to the Releases section of the GitHub repository.
- Download the latest release of the application.
- Extract the downloaded files and run
WinSSHCopyId.exe
.
- Run the application by executing the
WinSSHCopyId.exe
file. - Enter the following details in the respective fields:
- Host: The hostname or IP address of the remote server.
- Username: The username to log in to the remote server.
- Password: The password for the username (if required).
- Public Key: The SSH public key to be added to the remote server.
- Click the
Copy
button to add the public key to theauthorized_keys
file on the remote server.
-
Open a command prompt.
-
Run the application with the required arguments:
WinSSHCopyId.exe -i <PublicKeyPath> <username>@<host>
or in quiet mode (
-q
) (requires password in CLI argument):WinSSHCopyId.exe -q -i <PublicKeyPath> <username>:<password>@<host>
-
Enter the password when prompted.
Here is an example of how to use WinSSHCopyId:
- Enter the remote server details:
- Host:
example.com
- Username:
user
- Password:
bla bla bla password...
- Public Key:
ssh-rsa AAAAB3Nza...
- Host:
- Click
Copy
. - The application will log the process in the console window, indicating whether the key was successfully added or if it already exists.
WinSSHCopyId.exe -i C:\Users\John\.ssh\id_rsa.pub john@ubuntu-linux
or in quiet mode (-q
)
WinSSHCopyId.exe -q -i C:\Users\John\.ssh\id_rsa.pub john:password1234@ubuntu-linux
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make and commit your changes (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Renci.SshNet for the SSH.NET library used in this project.
- Inspiration from the
ssh-copy-id
utility available on Unix-based systems.
For any questions or feedback, please open an issue on the GitHub repository.