简体   繁体   English

SSH进入树莓派

[英]SSH into raspberry pi

I have a question regarding SSH. 我有关于SSH的问题。 For school assignments, I always write code on my mac then transfer it over on my raspberry pi to make sure it will compile correctly without errors as they are tested on the pi and sometimes when I transfer it has errors. 对于学校作业,我总是在Mac上编写代码,然后将其转移到我的raspberry pi上,以确保它在pi上经过测试时正确编译,并且没有错误,有时在我转移时会出现错误。

To avoid hassle of connecting everything to the pi, if I SSH into the pi, then compile my program from my mac, would it use the raspberry pi compiler? 为了避免将所有内容都连接到pi的麻烦,如果我通过SSH进入pi,然后从mac编译我的程序,它将使用raspberry pi编译器吗?

If you are connected vi ssh and issuing the commands in that terminal session, yes, it's going to use the compiler on the pi. 如果连接vi ssh并在该终端会话中发出命令,是的,它将在pi上使用编译器。

A better option, and more educational, might be to cross-compile the code for the pi on your mac. 更好的选择和更具教育意义的可能是在Mac上交叉编译pi的代码。 You can leverage the much greater processing power of the desktop to significantly reduce your compile time. 您可以利用台式机更大的处理能力来大大减少编译时间。

Cross Compiling on Mac OSX for Raspberry Pi 在Mac OSX上针对Raspberry Pi进行交叉编译

Yes it would remotely access the host's OS (in your case the RPi) to perform the compilation. 是的,它将远程访问主机的操作系统(在您的情况下为RPi)以执行编译。

Here is a guide to get you started: https://www.modmypi.com/blog/remotely-accessing-the-raspberry-pi-via-ssh-console-mode 这是一个入门指南: https : //www.modmypi.com/blog/remotely-accessing-the-raspberry-pi-via-ssh-console-mode

Also, in case you want a remote desktop connection, on your raspberry pi enter the following command: 另外,如果需要远程桌面连接,请在树莓派上输入以下命令:

sudo apt-get install xrdp

providing you've already updated and upgraded your package libraries ;) 提供您已经更新和升级的软件包库的信息;)

是的,如果您正在使用ssh并在该终端会话中编写代码,则该代码将在pi中进行编译,这是最好的方法。

Issuing command in the terminal session via SSH (laptop connected with Raspi), compilation will be done at Raspi. 在终端会话中通过SSH(与Raspi连接的笔记本电脑)发出命令,编译将在Raspi进行。 PuTTY is a very useful tool for this, you just need to enable SSH at Raspi and input your IP address at PuTTY only! PuTTY是一个非常有用的工具,您只需要在Raspi启用SSH并仅在PuTTY输入您的IP地址即可! Click to the PuTTY website http://www.putty.org/ and download it. 单击以访问PuTTY网站http://www.putty.org/并下载。

Secure Shell (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. 安全外壳(SSH)是一种加密网络协议,用于在不安全的网络上安全地运行网络服务。 The best-known example application is for remote login to computer systems by users. 最著名的示例应用程序是用于用户远程登录计算机系统。

When you connect to any remote system or server via ssh you are using the same system via command prompt. 通过ssh连接到任何远程系统或服务器时,您将通过命令提示符使用同一系统。 So, if you do any work via SSH the compilation will be done by the remote system. 因此,如果您通过SSH执行任何工作,则编译将由远程系统完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM