For remote connection Secure Shell Protocol
Default Port 22 protocol version SSH2
Mainly includes SSH remote connection SFTP service
Service-Side OpenSSH
# Rpm-qa OpenSSH OpenSSL
Openssh-5.3p1-94.el6.x86_64
OPENSSL-1.0.1E-15.EL6.X86_64 is responsible for encryption
Process
# Ps-ef | grep sshd
Root 1243 1 0 19:06? 00:00:00/usr/sbin/sshd
RSA DSA Key Support
Public Key Pivate Key
Version 1.X
# less/etc/ssh/sshd_config configuration file
# grep serverkey/etc/ssh/sshd_config Temporary public key
#ServerKeyBits 1024
# SSH [email protected] will accept the server's public key
The authenticity of host ' 192.168.10.10 (192.168.10.10) ' can ' t be established.
RSA key fingerprint is C6:94:5F:AF:17:75:7F:DD:BC:2A:54:83:F3:5A:D2:DC.
Is you sure want to continue connecting (yes/no)?
Client will generate Private Key # Cat/etc/ssh/ssh_config
# ll ~/.ssh/known_hosts
-rw-r--r--1 root root 395 April 3 19:37/root/.ssh/known_hosts
Serverkey + Private Key =key pair generates this key pair,,, to exchange data through this
Danger: Exchange data thereafter does not check key pair
Version 2 Adds a diffie-hellman mechanism to confirm online correctness
Check that the data is sourced correctly.
Based on password
Based on the key
# Netstat-lntup | grep 22
TCP 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1162/sshd
TCP 0 0::: $:::* LISTEN 1162/sshd
# Lsof-i: 22
COMMAND PID USER FD TYPE DEVICE size/off NODE NAME
sshd 1162 root 3u IPv4 10478 0t0 TCP *:ssh (LISTEN)
sshd 1162 Root 4u IPv6 10480 0t0 TCP *:ssh (LISTEN)
sshd 1437 Root 3r IPv4 11491 0t0 TCP 192.168.10.11:ssh->bogon:62818 (established)
# Nmap 192.168.10.10-p1-65535 Scan Port
Basic commands
# SSH [email protected]
# SSH [email protected] Ifconfig
# SCP XX [email protected]:/tmp cp file XX to/tmp
# SCP [email protected]:/tmp/xx. Instead
SFTP
# SFTP [email protected]
Put/root/xx/tmp upload plus client local path
sftp> get/root/xx/tmp Download to the local current directory
This article is from the "what-all" blog, please be sure to keep this source http://hequan.blog.51cto.com/5701886/1761324
Linux SSH Basic