2016年5月14日 星期六

How to install SSH,WinSCP and VNC in Raspbarry pi 3(如何在Raspbarry pi 3安裝SSH,WinSCP,VNC)


   This tutarial show how to use SSH and VNC to connect Raspbarry pi3 and your PC.

 Also see How to install Ubuntu Mate 16.04 in Raspbarry Pi 3
http://arbu00.blogspot.tw/2016/05/how-to-install-ubuntu-mate-1604-in.html


Step 1:Enable SSH service
In fact, SSH already installed in Ubuntu mate 16.04 .
so you can just in terminal type:



$ ssh

to check SSH already be installed or not.
and type

$ ps ax

to check SSH server already running or not?
if you can see message like as below,It means SSH server is running normally.




or You can try to use below command to install SSH and Start SSH.

#Install SSH.
$ sudo apt-get install ssh

#Start SSH
$ sudo /etc/init.d/ssh start
$ sudo update-rc.d ssh defaults


Step 2:Using below command to query your Raspbarry pi IP address.

$ sudo ifconfig


then in Your PC site open "putty.exe"  tool.
to enter above IP address and Port 22(default) and "open".


IF setting is no problem,you can key in your account and password  then connected successfully.
Now,You can controll your Raspbarry pi on your PC site.

Step 3:Install WinSCP.

download WinSCP from below website and install it on your PC.
https://winscp.net/eng/download.php

We can use WinSCP  tool to trasnfer files between  PC and Raspbarry pi 3.
It is very convinent and useful.It means you can modify files(like as Python script) on your PC  then
transfer to Raspbarry pi to run thru WinSCP  .

 The setting also is easy like as putty.exe.


The same as putty.exe,If this is the first time to connect the server ,it will appear below warning message.Don't care about it just go head and next it won't appear again.


IF successfully,you will see below files manager.Now ,it is easy transfer files between PC and Raspbarry pi .Just using Mous to drag &drop,and you also can use files search function .






Step 4:Install VNC in Raspbarry pi 3.
Using below command to install VNC.

$ sudo apt-get update
$sudo apt-get install tightvncserver

after installed,use below command to set VNC sersver password.

$sudo  tightvncserver
 and it will request you set the password.


then use below command to start  VNCserver.

$ sudo vncserver :1



Step 4:Download VNC Viewer
https://www.realvnc.com/download/viewer/

setting IP address and VNC  server port to connect.



When connecting successfully,you will see below screen.SSH just TEXT mode and VNC can use for GUI mode.



Right site is the PC with VNC and left site is the raspbarry pi.


**Troubleshooting: "After installed VNC server,Can not log in with original root Account"

After I install VNCserver and started it .Yes,it can work normally.but when reboot the Raspbarry pi system.System happen one issue ."Can not log in with original root Account" even if your password is right but it refused you log in the desktop .but if you use Guest accout w/o any password.you can entry the Guest desktop.At this moment,the SSH still can work well,so I used putty.exe to connect
raspbarry and it is strange thing that I can use orignal root accout "ss" log in terminal and do root action.

   I looked for this issue from google and found out below discussion with the same issue.
please also reference below website:
https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=27905

Currently.My solution is that I made one vnc.sh file as below.

#!/bin/sh -e
#
# run vncserver
#
sudo vncserver :1
sudo chown ss:ss .Xauthority
exit 0

When start vncserver and use chown command to change the  previleage.
so I run vnc.sh like as below command to start VNC server without login isssue .

$ sudo sh vnc.sh





Also See:

How to install OPENCV in Raspbarry pi 3.(如何在樹梅派上安裝OPENCV)
http://arbu00.blogspot.tw/2016/05/how-to-install-opencv-in-raspbarry-pi.html

加入阿布拉機的3D列印與機器人的FB粉絲團
https://www.facebook.com/arbu00/

Scan QRcode to join FB Fans.

沒有留言:

張貼留言