Telnet: Telnet protocol
Using C/S architecture, clear text is used throughout.
The application layer protocol, which works on TCP 23 ports.
S:telnet Server
C:telnet Client
Ssh:secure Shell
The application layer protocol, which works on TPC 22 Port.
Both the communication process and the authentication process are encrypted, based on the host authentication.
User authentication process Encryption
Data transfer Process Encryption
Host key Hostkey:
Asymmetric encryption
Secert Key
Public key
OpenSSH
Server side: sshd
Configuration file:/etc/ssh/sshd_config
Client: SSH
Configuration file:/etc/ssh/ssh_config
#ssh-keygen [OPTION] key generator
[OPTION]
-T TYPE Specifies the encryption method, commonly used for RSA|DSA
-F keyfile Specifies the private key file.
-P ' PASSWORD ' specifies the password for the encrypted private key, ' indicates a blank password.
The generated key is stored in:
/home/username/.ssh/id_rsa the generated private key
/home/username/.ssh/id_rsa.pub generated Public key
Note: The permissions for the. SSH folder can only be 700!
The generated public key is saved to the relevant file in the home directory of the remote host username and can only be appended and not overwritten:
/home/username/.ssh/authorized_keys
Or
/home/username/.ssh/authorized_keys2
The permissions for the file are 600!
For example:
#ssh-keygen-t RSA
#scp/root/.ssh/id_rsa.pub [Email protected]:/tmp
#ssh [email protected] ' cat/tmp/id_rsa.pub >>/home/hadoop/.ssh/authroized_keys '
Or
#ssh-keygen-t rsa-f. Ssh/id_rsa-p "
#ssh-copy-id-i [email protected]
#ssh-copy-id [OPTION] [[Email protected]]host transfer the public key to a remote server
[OPTION]
-I pubkeyfile specifying a public key file
For example:
#ssh-copy-id-i. Ssh/authorized_keys [Email protected]
#scp [OPTION] SRC DEST cross-Host secure Replication tool.
[OPTION]
-R recursion
-A All
Src
[Email protected]:D IR
Localdir
DEST
[Email protected]:D IR
Localdir
For example:
#scp/root/busybox.tar.gz [Email protected]:/home/hadoop/
#scp [Email protected]:/home/hadoop/busybox.tar.gz/root/
#ssh [OPTION] [[email protected]]host ' COMMAND '
[OPTION]
-L USERNAME HOST
To store files from the host key accepted by the server:
/home/username/.ssh/kown_hosts
Dropbear: Embedded system-specific SSH server and client Tools
Server side: Dropbear
Key Generation tool:
Dropbearkey
Client: Dbclient
Dropbear using Nsswitch for name resolution by default
Nsswitch Required Documents:
/etc/nsswitch.conf
/lib/libnss_file*
/usr/lib/libnss3.so
/usr/lib/libnss.file*
Dropbear or checks to see if the default shell is the security shell of the current system when the user logs on. The security shell is defined within the/etc/shells.
Host key default location:
/etc/dropbear/
Dorpbear_rsa_host_key
Variable length, is a multiple of 8, the default is 1024
Dorpbear_dss_host_key
Fixed length, default is 1024
#dropbearkey [OPTION]
-T TYPE RSA|DSA
-F KeyFile
-S SIZE
This article is from "Small Private blog" blog, please be sure to keep this source http://ggvylf.blog.51cto.com/784661/1616796
Linux ssh and Dropbear