Creating SSH keys
keywords: cat authorized key
These directions worked for a Mac OS X computer.
On the home computer:
ssh-keygen -t dsa
Accept the defaults. Despite the term pass-phrase, as opposed to password, if you choose to use one, keep your passphrase short.
cd /Users/you/.ssh
(Change "you" to your username, the default place the previous command generates the key)
Note: From here on these instructions are the same as after you add a user to your server with adduser and they send you a public key file so you can give them ssh access.
scp id_dsa.pub you@example.com:~
Use your real server username in place of "you" and your real server in place of example.com (keep the :~
which puts it in your directory.) Or if putting the key up for another user you can use /home/username
(username being what you created with adduse) after the colon instead of the tilde.
On the server:
cat ~/id_dsa.pub >> ~/.ssh/authorized_keys
If the user has no .ssh directory or authorized_keys file, you must create them. Agaric's own documentation details the permissions wen need for .ssh/ and authorized_keys. In this case, the servername is stedile and the user's name is username and provided the file usernamepub.txt with their public key, this is the file we scp'd up earlier into their directory, running the shell code scp usernamepub.txt agaric@stedile.com:/home/username
from the directory that held the public key file on our home computer. So, on to putting this public key somewhere, on the server now, acting as the root user incidentally but this would work with sudo:
cd /home/username/
1 stedile:/home/username# mkdir .ssh
0 stedile:/home/username# cat usernamepub.txt >> .ssh/authorized_keys
0 stedile:/home/ori# chown -R ori:ori .ssh/
0 stedile:/home/ori# chmod 600 .ssh/authorized_keys
We also checked and edited the authorized_keys file vi .ssh/authorized_keys
), removing "This is a public key" style comments:
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20070104"
We removed, along with:
---- END SSH2 PUBLIC KEY ----
Not sure if that was a good idea or not yet... the authorized_keys file we know works contains this:
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAdidpqM0kQfEypO4zBzgEpfcVAyouZT7VpHbL+NfaEPa5Pexpect08TdljXDnLT0MA4TthisV58JFiBayHhymXtoNrsKKNqjb49Gbe4AtDSwtotallyEN9IjoubI8TteFSsl23RncVOAsFbtbrandom?6KdmL/9Gkeq75eZtvxmmIPITbgAYn9RgKUtw==
That's pretty much it, these directions worked for Agaric!
Keywords:
make new Id dsa
keywords: cat authorized key
These directions worked for a Mac OS X computer.
On the home computer:
ssh-keygen -t dsa
Accept the defaults. Despite the term pass-phrase, as opposed to password, if you choose to use one, keep your passphrase short.
cd /Users/you/.ssh
(Change "you" to your username, the default place the previous command generates the key)
Note: From here on these instructions are the same as after you add a user to your server with adduser and they send you a public key file so you can give them ssh access.
scp id_dsa.pub you@example.com:~
Use your real server username in place of "you" and your real server in place of example.com (keep the :~
which puts it in your directory.) Or if putting the key up for another user you can use /home/username
(username being what you created with adduse) after the colon instead of the tilde.
On the server:
cat ~/id_dsa.pub >> ~/.ssh/authorized_keys
If the user has no .ssh directory or authorized_keys file, you must create them. Agaric's own documentation details the permissions wen need for .ssh/ and authorized_keys. In this case, the servername is stedile and the user's name is username and provided the file usernamepub.txt with their public key, this is the file we scp'd up earlier into their directory, running the shell code scp usernamepub.txt agaric@stedile.com:/home/username
from the directory that held the public key file on our home computer. So, on to putting this public key somewhere, on the server now, acting as the root user incidentally but this would work with sudo:
cd /home/username/
1 stedile:/home/username# mkdir .ssh
0 stedile:/home/username# cat usernamepub.txt >> .ssh/authorized_keys
0 stedile:/home/ori# chown -R ori:ori .ssh/
0 stedile:/home/ori# chmod 600 .ssh/authorized_keys
We also checked and edited the authorized_keys file vi .ssh/authorized_keys
), removing "This is a public key" style comments:
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20070104"
We removed, along with:
---- END SSH2 PUBLIC KEY ----
Not sure if that was a good idea or not yet... the authorized_keys file we know works contains this:
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAdidpqM0kQfEypO4zBzgEpfcVAyouZT7VpHbL+NfaEPa5Pexpect08TdljXDnLT0MA4TthisV58JFiBayHhymXtoNrsKKNqjb49Gbe4AtDSwtotallyEN9IjoubI8TteFSsl23RncVOAsFbtbrandom?6KdmL/9Gkeq75eZtvxmmIPITbgAYn9RgKUtw==
That's pretty much it, these directions worked for Agaric!
Keywords:
make new Id dsa
Comments
Post new comment