You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
540 B
16 lines
540 B
#!/bin/sh |
|
|
|
# Prompt user for player name |
|
echo "Enter a player name:" |
|
read player_name |
|
|
|
# Check if key files already exist |
|
if [ -f ~/.ssh/${player_name} ] && [ -f ~/.ssh/${player_name}.pub ]; then |
|
echo "Key files for player ${player_name} already exist. Please enter a different player name:" |
|
read player_name |
|
fi |
|
|
|
# Generate ssh key |
|
ssh-keygen -t rsa -b 4096 -C "${player_name}@MUD" -f ~/.ssh/${player_name} -q -N "" |
|
|
|
echo "New player ${player_name} created with ssh key files at ~/.ssh/${player_name} and ~/.ssh/${player_name}.pub"
|
|
|