Linux Windows SSH

SSH to Windows/Linux

23

, , , . , :

  • Secure Shell (SHH) Linux
  • (RDP - Remote Desktop Protocol) Windows

. , , , .

, :

  • IP- ,

SHH?

Secure Shell, Secure Socket Shell, - , .

SSH , , , .

, , .


SSH?

, SSH-, : . , , SSH , , . , , , .

, SSH (SSH daemon - sshd). TCP/IP . , SSH , , .

SSH SSH SSH 2.


SSH-

SSH- , , , . OpenSSH SSH , Linux. OpenSSH . , . , Ubuntu SSH- .

OpenSSH

SSH, , . Linux . Windows PuTTY , .

, Linux, :

  1. SSH. CTRL+ALT+T .
  2. ssh Enter.
  3. , :
username@host:~$ ssh

usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-E log_file] [-e escape_char]
[-F configfile] [-I pkcs11] [-i identity_file]
[-J [user@]host[:port]] [-L address] [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address] [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
[user@]hostname [command]

username@host:~$

, . OpenSSH:

  1. , OpenSSH : sudo apt-get install openssh-client
  2. Enter, .

SSH , , IP-.

OpenSSH

, SSH-, SSH.

, OpenSSH Ubuntu , SSH-, :

  1. . CTRL+ALT+T .
  2. ssh localhost Enter.
  3. , SSH-, :
username@host:~$ ssh localhost
ssh: connect to host localhost port 22: Connection refused username@host:~$    

, OpenSSH. :

  1. , SSH:sudo apt-get install openssh-server ii
  2. .
  3. Enter Y, .

, , SSH- , :

sudo service ssh status

, SSH :

username@host:-$ sudo service ssh status
 ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enab
Active: active (running) since Fr 2018-03-12 10:53:44 CET; 1min 22s ago Process: 1174 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCES

Main PID: 3165 (sshd)

, OpenSSH , ssh localhost . :

username@host:~$ ssh localhost

The authenticity of host 'localhost (127.0.0.1)' can't be established. ECDSA key fingerprint is SHA256:9jqmhko9Yo1EQAS1QeNy9xKceHFG5F8W6kp7EX9U3Rs. Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.

username@host:~$    

yes y, .

! SSH- SSH.

SSH. , SSH-. :

sudo nano /etc/ssh/sshd_config

, . Nano. Nano, :

sudo apt-get install nano

, SSH , - sshd_config. , :

sudo service ssh restart

SSH

, OpenSSH, , . :

  1. SSH- : ssh your_username@host_ip_address. , , : ssh host_ip_address Enter.
  2. Enter. , . , , , .
  3. , , . yes Enter. ( ), .
  4. ECDSA , .

, , , , IP- IP-. IP-. , , TCP-, OpenSSH , . 22, sshd_config. IP- .

OpenSSH :

username@machine:~$ ssh phoenixnap@185.52.53.222 p7654 phoenixnap@185.52.53.222s password:

The authenticity of host '185.52.53.222 (185.52.53.222)' can't be established. ECDSA key fingerprint is SHA256:9lyrpzo5Yo1EQAS2QeHy9xKceHFH8F8W6kp7EX2O3Ps. Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ' 185.52.53.222' (ECDSA) to the list of known hosts. 

username@host:~$    

. , , :

  • IP-
  • , SSH,
  • SSH

SSH

, SSH, SSH. , , .

SSH sshd:

  • TCP- , SSH. 22 , , 24596. , , , 222, 2222 22222.
  • SSH SSH . , . .
  • . , . , , .
  • root- su root-.

TCP Wrappers IP- . , TCP Wrappers, /etc/hosts.allow etc/hosts.deny.

, . , SSH- , , etc/hosts.deny:

sshd : ALL
ALL : ALL    

etc/hosts.allow SSH. IP-, IP- : sshd: 10.10.0.5, LOCAL.

, , . , SSH , , , , . - Fail2ban.


VNC SSH

, (VNC - Virtual Network Computing), SSH. VNC SSH, Linux UNIX:

$ ssh -L 5901:localhost:5901 -N -f -l username hostname_or_IP

:

  • ssh: SSH SSH .
  • -L 5901:localhost:5901: , . 5901 .
  • -N: , .
  • -f: SSH , . .
  • -l username: .
  • hostname_or_IP: VNC. IP- 172.16.0.5, myserver.somedomain.com.

SSH- Windows, PuTTY. PuTTY :

PyTTY
  • Connections () -> SSH -> Tunnels ()
  • Source port ( ) 5901
  • Destination () localhost:5901
  • SSH
  • VNC

RDP?

(RDP - Remote Desktop Protocol) , Microsoft. Windows.

Secure Shell, , RDP-, , , .

, , , .

. (VPN - virtual private network), RDP , SSH, . , , , Windows. . RDP , .

?

Windows - (RDP). Windows 3389. , Windows, , . , , , .

, Windows, , . , , Pro, Enterprise Server Windows. , , RDP- Windows.


RDP-

Windows. Windows, , Windows. Windows.

, , , :

  • . VPN, , IP- . , , TCP- ( 3389) IP- , . , Windows .
  • VPN. . , .
  • . , , , . RDP, .

Windows 7, 8, 10 Windows Server

Windows. . , , , , VPN .

1.

, :

  1. Computer ( ) This PC ( ) Windows.
  2. Properties ().
  3. Remote settings ( ) . Remote settings
  4. Allow remote connections to this computer ( ). . , Allow connections only from computers running Remote Desktop with Network Level Authentication (recommended) ( , ()) RDP. Allow remote connections to this computer
  5. Apply (), , , .
2. .

, , , . , , . :

  1. Remote Settings ( ), , Select Users ( )
  2. Add () Remote Desktop Users ( ).
  3. Select users ( ). , , Locations ().
  4. Enter the Object Names to Select ( ) Check Names ( ).
  5. , OK.
  6. System Properties ( ), .

, . , .

, . Windows, Windows 7.

1:

Windows Remote Deskrop Connection ( ). :

  1. Windows 7 Start () -> All Programs ( ), Accessories () Remote Desktop Connection ( ). Windows 10 Start () Windows Accessories ( Windows), Remote Desktop Connection ( ). Remote Desktop Connection
  2. Start () Remote Desktop Connection ( ) . , . , . Remote Desktop Connection
  3. Windows + R , Run (). mstsc Open () Enter, . mstsc
2. IP- .

Remote Desktop Connection ( ) , IP- , .

Computer () IP- Connect ().

Connect
. ( 3389) , IP-.: 174.163.152.141:6200

IP- . :

  • , IP- .
  • (VPN) , IP- .
  • VPN, IP-.
IP-

, IP- , . :

IP- :

  1. CMD (start) Windows + R , CMD Enter, .
  2. ipconfig Enter.
  3. IP- IPv4 Address.IPv4 Address

IP- :

  • - google.com .
  • what is my IP ( IP) my IP ( IP) Enter.
  • Google IP-, . , - , IP-. .

:

  1. Computer ( ) This PC ( ), Windows.
  2. Computer name, domain, and workgroup settings ( , ).
3. RDP

, Connect (), . , , :

  1. . .
  2. OK, , .
  3. Yes (), .
. Windows . - , , . .

. , .

RDP. , .

, , :

  • VPN- Windows . Windows.
  • . Not configured ( ). . Client Compatible ( ). High (), 128- , . .
  • .
  • , RDP , TCP- RDP 3389, . Windows , IP-

RDP . , .


, , Linux Windows. Linux Windows.

, , .


50% Merion Academy