当前位置:网站首页>Network remote access using raspberry pie

Network remote access using raspberry pie

2022-06-25 10:53:00 Chleto

One 、 Software preparation

1. Raspberry pie mirror image

Official website :Raspberry Pi OS – Raspberry P

2.SDCardFormatterv5i

SD Memory Card Formatter | SD Association (sdcard.org)

3. Burning tools Raspberry Pi

Raspberry Pi

4.putty

Download PuTTY: latest release (0.77) (greenend.org.uk)

Two 、 Implementation process

Open it up and download okay SDCardFormatter Take us SD Format the card
![ Insert picture description here ](https://img-blog.csdnimg.cn/640f1ab848dc487a9ba4b074c4785e4b.png
 Insert picture description here
Burn
 Insert picture description here
 Insert picture description here
open sd Card to create an empty text file wpa_supplicant.conf

country=CN
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
 
network={
	ssid=" Your wireless network name "
	psk=" Your wireless password "
	key_mgmt=WPA-PSK
	priority=1
}

take SD Unplug the card, insert the raspberry pie and connect the power to the raspberry pie , You can see on your phone that raspberry pie has been connected , Check out the raspberry pie ip Address , You can download one Advanced IP Scanner, Open terminal input ipconfig, View the wireless hotspot IP Address , And then in IP Scanner Mid search
 Insert picture description here
 Insert picture description here
 Insert picture description here
putty Remote connection
 Insert picture description here
 Insert picture description here
Configure raspberry pie sudo raspi-config
 Insert picture description here
 Insert picture description here
 Insert picture description here
open VNC Viewer

Type in the raspberry pie ip, Then enter the account and password

 Insert picture description here

3、 ... and 、 Create an account and create... In your personal folder assert Assertion c Program

1、 Create user

 Insert picture description here
create a file assert.c, Enter in file

#include <assert.h>
#include <stdio.h>
 
int main()
{
   int a;
   char str[50];
     
   printf(" Please enter an integer value : ");
   scanf("%d", &a);
   assert(a >= 10);
 
   printf(" The integer entered is : %d\n", a);
    
   printf(" Please enter the string : ");
   scanf("%s", str);
   assert(str != NULL);
 
   printf(" The input string is : %s\n", str);
    
   return(0);
}

 Insert picture description here
Use gcc compile
 Insert picture description here

Four 、 Use scp The command is on two Linux Data transmission between systems

scp

scp yes secure copy Abbreviation , yes linux Based on ssh Log in for secure remote file copy command .scp It's encrypted. ,rcp It's not encrypted ,scp yes rcp The enhanced .

because scp The transmission is encrypted , It may affect the speed a little . in addition ,scp It doesn't take up resources , It will not increase the system load much , At this point ,rsync It's far less than that . although rsync Than scp It will be faster , But when there are lots of small files ,rsync It will cause the hard disk I/O Very high , and scp Basically does not affect the normal use of the system .

scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[[email protected]]host1:]file1 [...] [[[email protected]]host2:]file2
 
 
// Parameter description 
-1:  mandatory scp Command usage protocol ssh1
-2:  mandatory scp Command usage protocol ssh2
-4:  mandatory scp The command only uses IPv4 Addressing 
-6:  mandatory scp The command only uses IPv6 Addressing 
-B:  Use batch mode ( Do not ask for transmission password or phrase during transmission )
-C:  Allow compression .( take -C The sign is passed on to ssh, To turn on compression )
-p:  Keep the modification time of the original document , Access time and access rights .
-q:  Do not show transfer progress bar .
-r:  Recursively copy the entire directory .
-v:  Detailed display output .scp and ssh(1) The debugging information of the whole process will be displayed . This information is used to debug connections , Validation and configuration issues .
-c cipher:         With cipher Encrypt the data transmission , This option will be passed directly to ssh.
-F ssh_config:     Designate an alternative ssh The configuration file , This parameter is passed directly to ssh.
-i identity_file:  The key file used to read the transfer from the specified file , This parameter is passed directly to ssh.
-l limit:          Limit the bandwidth that users can use , With Kbit/s In units of .
-o ssh_option:     If you are used to using ssh_config(5) Parameter passing method in ,
-P port:           Notice that it's capital P, port Is the port number used for data transmission 
-S program:        Specify the program to use when encrypting the transmission . This procedure must be able to understand ssh(1) The option to .
原网站

版权声明
本文为[Chleto]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206251021457850.html