Raspbian 11-13, setup steps 2019-01-17

First, flash into TF card, creat a new file with name: ssh without suffix and wpa_supplicant.conf type command and save:

country=CN
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="yours"
    psk="passwd"
    key_mgmt=WPA-PSK
    priority=1
}

#if you have 2 or more local networks show specified sequence to system by "priority"

network={
    ssid="another"
    psk="passwd2"
    key_mgmt=WPA-PSK
    priority=2
}

employ 2 files to root directory and copy necessary display drivers

PS: after the raspberry pi boot completed, it will be automatically added to the /etc/wpa_supplicant/wpa_supplicant.conf for intranet automatic connection.

wpa_supplicant.conf structure as follow:

// 详细介绍:
#ssid:网络的ssid
#psk:密码
#priority:连接优先级,数字越大优先级越高(不可以是负数)
#scan_ssid:连接隐藏WiFi时需要指定该值为1

// 如果你的 WiFi 没有密码
network={
ssid="你的无线网络名称(ssid)"
key_mgmt=NONE
}
// 如果你的 WiFi 使用WEP加密

network={
ssid="你的无线网络名称(ssid)"
key_mgmt=NONE
wep_key0="你的wifi密码"
}
// 如果你的 WiFi 使用WPA/WPA2加密

network={
ssid="你的无线网络名称(ssid)"
key_mgmt=WPA-PSK
psk="你的wifi密码"
}

then modify the config.txt with follow text:

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1 #可以去掉开机屏幕周围的黑色边框

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1#

# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2 #DMT模式
hdmi_mode=58 #分辨率为适应屏幕分辨率的选择

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

save the file, insert the TF card to Raspberry Pi 3B+, power on, just 5 mins later boot completed, putty logon

pi:raspberry

Using username "pi".
[email protected]'s password:
Linux raspberrypi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Nov 13 14:11:07 2018

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.
 

the regular logon screen shown as above, if shown the information as follow:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:EqIFQoWYDISyGnJggyqnk8888LeNn3tr1+QmBQaso0.
Please contact your system administrator.
Add correct host key in /Users/caolijian/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/caolijian/.ssh/known_hosts:12
ECDSA host key for 192.168.1.112 has changed and you have requested strict checking.
Host key verification failed.

you have to clean up the previously saved authentication key

// 查看秘钥
ssh-keygen -l -f ~/.ssh/known_hosts
// 清理192.168.1.112的认证rsa
ssh-keygen -R 192.168.1.112
// 查看莓派版本信息
pi@raspberrypi:~ $ cat /proc/cpuinfo

// 查看日期
pi@raspberrypi:~ $ date

if shown information as UTC/GMT you have to change the timezone with the command line

pi@raspberrypi:~ $ sudo dpkg-reconfigure tzdata
// 选择亚洲上海

// 启动 NTP 使计算机时钟与 Internet 时间服务器同步
pi@raspberrypi:~ $ sudo timedatectl set-ntp true

The important comes: change the sources of mirriors!

the respbian version is stretch. so wo have replace the sources localization :

1. modify /etc/apt/sources.list.d/raspi.list file with nano -w 

after my test ustc.edu.cn have some warning and guid lost ! choose tinghua 

pi@raspberrypi:~$ sudo cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi.list.bak  
#备份为 raspi.list.bak
pi@raspberrypi:~$ sudo nano -w /etc/apt/sources.list.d/raspi.list     #编辑raspi.list  文件
清华 
deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui
deb-src https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui

2. modify /etc/apt/sources.list with alibaba mirrors:

pi@raspberrypi:~$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak  #备份为 sources.list.bak
pi@raspberrypi:~$ sudo nano /etc/apt/sources.list     #编辑sources.list  文件
阿里云 
deb http://mirrors.aliyun.com/raspbian/raspbian/ stretch main contrib non-free rpi
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ stretch main contrib non-free rpi
pi@raspberrypi:~$ sudo apt-get update       #更新系统软件
pi@raspberrypi:~$ sudo apt-get upgrade       #更新已安装的包

all package will renew for minutes.

keyboard layout modify method:

// 进入设置页面 方法一
sudo dpkg-reconfigure keyboard-configuration

// 进入设置页面 方法二
sudo raspi-config
// 选择 4 Localisation Options -> I3 Change Keyboard Layout

Generic 101-PC-> English(US) -> English(US, alternative international) -> OK

if no reponse you have check the keyboard connection. 

install VNC

Method 1. through windows MStsc controll

// (基于Debian 9)直接执行
sudo apt-get install -y xrdp

Method 2. through VNC view:

sudo apt-get install tightvncserver

sudo tightvncserver

CLI will shown information:
New 'X' desktop is raspberrypi:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/raspberrypi:1.log

Attention: don't forget the port "1" after the ip add while connecting via VNC viewer

MSTSC and VNC both nails, MSTSC has the Window Adaptation function, easy to use!

猜你喜欢

转载自blog.csdn.net/xatsoft/article/details/86521697