Data transmission and remote instruction execution based on SSH protocol password-free OPENWRT environment

Source: Internet
Author: User
Tags scp command ssh server dropbear

This name is a bit too X-loaded.

In fact, the problem is very simple, in general, OpenWrt run on some embedded platforms or routers, and this platform often does not have too many resources, such as hard disk storage. However, some data, such as traffic can only be captured temporarily deposited on it, the accumulation of time, if not to copy the data back and delete the OpenWrt on, it will cause insufficient space. Of course, in this process, it is inevitable to use some scripts, use some commands, then, how to execute the command remotely.

First, the openwrt I used was the barrier breaker version, and the other versions were untested.
Back to the question, how to solve it. One approach, of course, is NFS, but in the end there is no success and it stops at the problem:

Mount.nfs:No such device


The problem with this post is basically the same, Http://www.openwrt.org.cn/bbs/thread-509-1-1.html,cat/proc/filesystems also found no support for NFS, I think my system was actually cloned from someone else's vmdk, perhaps the kernel was compiled without the NFS module. Anyway, this method still gives up!

So, we go to the second method, using SCP remote back copy.

One of the biggest problems we want to do with the SCP command in a script is what the password does. Fortunately, there are password-free copies and logins for SCP and SSH. You can refer to these articles:

http://it.oyksoft.com/post/1836/http://www.thegeekstuff.com/2008/06/ Perform-ssh-and-scp-without-entering-password-on-openssh/http://www.360doc.com/content/13/1013/21/3884271_ 321222563.shtmlhttp://blog.csdn.net/shangzhiliang_2008/article/details/8602756

In this process, I took some detours, write here, do a small note, also lest see people continue detours.

A lot of documents with the first article above, how to come up, but for a long time, you find how still can not do, so at this time you go to the almighty Google, found the second article, suddenly, the original one of the need to ask SSH services to the party must be OpenSSH, which is very obvious, We openwrt on the offer is dropbear ah, what to do, we want to change the SSH server?

The answer is of course no,no,no .... That's when we retrieve the OpenWrt SCP, and then you finally get the third document, which is short, but enough to tell us how to set it up in Dropbear. Well, in this way, the merit is Gaocheng. Then, before you SCP, you need to know what files are on the OpenWrt, you will use the fourth article, right, so down, you can use the script very convenient to monitor the copy OH.

Data transmission and remote instruction execution based on SSH protocol password-free OPENWRT environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.