Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexwiench/update-authorized_keys
A short bash script that pulls your public keys from Github and adds them to your .ssh/authorized_keys file.
https://github.com/alexwiench/update-authorized_keys
Last synced: 26 days ago
JSON representation
A short bash script that pulls your public keys from Github and adds them to your .ssh/authorized_keys file.
- Host: GitHub
- URL: https://github.com/alexwiench/update-authorized_keys
- Owner: alexwiench
- License: mit
- Created: 2019-07-16T18:22:01.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-11-13T19:09:07.000Z (about 3 years ago)
- Last Synced: 2024-10-15T07:47:12.141Z (2 months ago)
- Language: Shell
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Update ~/.ssh/authorized_keys with Github public keys
A short bash script that pulls your public keys from `github.com/UserName.keys` and adds them to the ssh `authorized_keys` file of your current user.
## Usage
This script can be run with or without arguments.
`./updatekeys.sh` or `./updatekeys.sh username y`Adding your GitHub _username_ and _y_ will allow cause this script to run without prompting the user, making it suitable for crontab or startup scripts.
> **Script not running?**
> Use `chmod +x ./updatekeys.sh` to give it executable permissions.## How to run on the go
### Download with cURL and run
1. `curl -fsSL https://raw.githubusercontent.com/alexwiench/Update-Authorized_Keys/master/updatekeys.sh -o updatekeys.sh`
2. `bash ./updatekeys.sh`> You can also use your username as a command line arugment for automating or quick usage.
> Example: `./updatekeys.sh username`### Run without downloading
`bash <(curl -fsSL https://raw.githubusercontent.com/alexwiench/Update-Authorized_Keys/master/updatekeys.sh) username`
---
### Notes
#### Sudo
This script is only designed to modify the `authorized_keys` file in the `$HOME` directory of your **current user** and will abort if it detects `sudo`.
Use `su` to switch users if you must.