Closed jialincheoh closed 1 year ago
Here this is the instructions we want to send (this is a fake example)
ssh-keygen -t rsa -b 4096 -o -a 100 -C <user>@<hostname>
sbrunswi
2EbYaMRhMV8gQttt
Note: Store this somewhere safe and don\'t rely on this file as a permanent solution.
**THIS STEP IS REQUIRED**
ssh-add /<path>/<to>/<keyfile>
> Enter passphrase for id_username_hostname: __
Identity added: id_username_hostname (username@hostname)
You can also set these parameters using commandline flags
(refer to ssh manual man ssh
for instructions)
### ~/.ssh/config
Host ironhub
Hostname 142.93.60.97
User <username>
IdentityFile /home/<username>/.ssh/id_<username>_<hostname>
ssh ironhub
reference article to add users for key based access -> https://thucnc.medium.com/how-to-create-a-sudo-user-on-ubuntu-and-allow-ssh-login-20e28065d9ff
Name: Brittany Green Email: brittany.green.1@louisville.edu Phone: (502)852-4787
Steps to create SSH keys
ssh-keygen
U already have ssh keys do
ssh-keygen -p -f ~/.ssh/id_rsa
Copy ssh keys into remote server
ssh-copy-id jialincheoh@128.46.86.105
Create new user account
$ sudo adduser newuser
Switch to the new user account
$ su - newuser
Add public key to allow remote SSH login for the new user
$ su - newuser
$ mkdir ~/.ssh
And paste your SSH public key here, save and close file
Use your favorite text editor for this. I use vim here, for example:
$ vim ~/.ssh/authorized_keys
Open another terminal on your machine and try to remote SSH login using new user.
$ ssh newuser@server_address
This should work if you have your SSH private key in ~/.ssh/id_rsa file, otherwise you must specify the path to your private key with -i option:
$ ssh -i path_to_your_ssh_private_key newuser@server_address
Finally download the key from the remote server and pass it to the relevant person.
scp brittany@128.46.86.105:/.ssh/id_rsa .
@jialincheoh - This is taken care off! However, we need a new issue on documentation of admin process!
To add users
To create users with admin rights
Verify if user is added
Relevant links: https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/