树莓派登录ssh 很慢和开机启动tightvncserver

设备:

  1. 树莓派3b,系统 raspbian

树莓派登录ssh很慢

在参考了参考列表的第1篇博文

  1. 关闭 ssh的gssapi认证
1
sudo vim /etc/ssh/ssh_config

在该文件的末尾找到这两行设置并注释掉

1
2
3
4
5
# GSSAPIAuthentication yes
# GSSAPIDelegateCredentials no

# 关闭ssh的UseDNS
UseDNS no

保存退出,重启ssh服务

1
sudo service sshd restart

tightvncserver开机启动

树莓派上安装vnc服务端(debian):sudo apt install tightvncserver
修改vnc密码:vncpasswd
vnc-server 开机启动文件:sudo vi /etc/init.d/tightvncserver ,在这个文件里输入如下内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
### BEGIN INIT INFO
# Provides: tightvncserver
# Required-Start: $syslog $remote_fs $network
# Required-Stop: $syslog $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts VNC Server on system start.
# Description: Starts tight VNC Server. Script written by James Swineson.
### END INIT INFO
# /etc/init.d/tightvncserver
VNCUSER='pi'
case "$1" in
start)
su $VNCUSER -c '/usr/bin/tightvncserver :1'
echo "Starting TightVNC Server for $VNCUSER"
;;
stop)
pkill Xtightvnc
echo "TightVNC Server stopped"
;;
*)
echo "Usage: /etc/init.d/tightvncserver {start|stop}"
exit 1
;;
esac
exit 0

然后给增加执行权限,并启动服务:

1
2
3
sudo chmod +x /etc/init.d/tightvncserver
sudo update-rc.d tightvncserver defaults # 添加开机启动
sudo update-rc.d tightvncserver remove #移除开机启动

References