User Tools

Site Tools


ssh_openssh_keys

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ssh_openssh_keys [2025/02/20 02:53] – [Work As SSH Server] jianwussh_openssh_keys [2025/02/26 03:55] (current) jianwu
Line 1: Line 1:
 +[[https://pctresearch.com/|{{:wiki_banner.jpg?nolink&800|}}]]
 +
 ===== SSH/OpenSSH/Keys ===== ===== SSH/OpenSSH/Keys =====
 To install the OpenSSH client applications on your Ubuntu system, use this command at a terminal prompt: To install the OpenSSH client applications on your Ubuntu system, use this command at a terminal prompt:
Line 81: Line 83:
 ==== Transfer Client Key to Host ==== ==== Transfer Client Key to Host ====
 The key you need to transfer to the host is the public one. If you can log in to a computer over SSH using a password, you can transfer your RSA key by doing the following from your own computer: The key you need to transfer to the host is the public one. If you can log in to a computer over SSH using a password, you can transfer your RSA key by doing the following from your own computer:
-<code Bash>+<code Dos>
 $ ssh-copy-id <username>@<host> $ ssh-copy-id <username>@<host>
 </code> </code>
Line 88: Line 90:
 In practice, copy and paste the entire contents of id_rsa.pub to the bottom of authorized_keys on the SSH server side. In practice, copy and paste the entire contents of id_rsa.pub to the bottom of authorized_keys on the SSH server side.
 ==== to show the key's bit-size and fingerprint ==== ==== to show the key's bit-size and fingerprint ====
-<code Bash>+<code Dos>
 $ ssh-keygen -l -f <key file name> $ ssh-keygen -l -f <key file name>
 </code> </code>
Line 96: Line 98:
 </code> </code>
 ==== SSH login ==== ==== SSH login ====
-<code Bash>+<code Dos>
 $ ssh <username>@<host> $ ssh <username>@<host>
 </code> </code>
 ==== Enter SSH passphrase once ==== ==== Enter SSH passphrase once ====
-<code Bash>+<code Dos>
 $ ssh-agent bash $ ssh-agent bash
 $ ssh-add ~/.ssh/id_rsa $ ssh-add ~/.ssh/id_rsa
Line 112: Line 114:
 C:\Users\<user name>\\ C:\Users\<user name>\\
 To create the keys, type: To create the keys, type:
-<code>+<code Bash>
 C:\Users\<user name> > ssh-keygen.exe C:\Users\<user name> > ssh-keygen.exe
   or   or
Line 122: Line 124:
 === WSL or ubuntu === === WSL or ubuntu ===
 /home/pctr/.ssh/config /home/pctr/.ssh/config
-<code Text>+<code Bash>
 host ubuntu host ubuntu
     ForwardAgent yes     ForwardAgent yes
Line 137: Line 139:
 === Windows === === Windows ===
 C:\Users\kan\.ssh\config C:\Users\kan\.ssh\config
-<code Text>+<code Dos>
 Host pctresearch Host pctresearch
   HostName host_name_of_server   HostName host_name_of_server
Line 144: Line 146:
   IdentityFile "C:\Users\ptsr\.ssh\file_name_of_private_key"   IdentityFile "C:\Users\ptsr\.ssh\file_name_of_private_key"
   IdentitiesOnly yes   IdentitiesOnly yes
 +  AddressFamily inet
   User pctresearch   User pctresearch
  
Line 150: Line 153:
     ServerAliveCountMax 10000     ServerAliveCountMax 10000
 </code> </code>
 +:!: AddressFamily - Specifies which address family to use when connecting. Valid arguments are any (the default), inet (use IPv4 only), or inet6 (use IPv6 only). 
 +
 Usage of ssh connection Usage of ssh connection
-<code Bash+<code Dos
-ssh pctresearch+ssh pctresearch
 </code> </code>
  
ssh_openssh_keys.1739987630.txt.gz · Last modified: 2025/02/20 02:53 by jianwu