Hello,

I have a TI AM3352 processor running embedded linux (angstrom 3.2.0).

I connect over SSH to the device.

I scp my application - I created (a hello world) into /home/root.

I changed the permissions on the file to executable.

When I try to run the application via ./HelloWorld

I get an error:

-sh: ./HelloWorld: not found

Not sure why I cannot run the application???

Can you not do this from SSH?

Any help would be greatly appreciated.

Recommended Answers

All 11 Replies

Executing code from ssh is not a problem. There are several possible problems. One is that your shell may not be in the directory you think. Another is that the permissions you think you gave the file are not correct or the file is no longer there. Try executing ls -l ./HelloWorld to see if it is there and that it has correct execution permissions. Finally, did you compile the source using either a compiler on the device, or the correct cross-compiler on your host system? Also, did you login as root, or another user? Bear in mind that allowing root ssh logins is considered insecure - most systems will block that in the sshd configuration files.

One last thing. The home directory for root's account is usually /root, not /home/root.

Thanks for the reply!

Here are my steps:

1) I cross-compiled for the target board.

2) Using WinSCP I login as root

3) I scp (binary mode) over to /home/root

4) I chmod on the file

5) I verify that permissions have changed via ls- all in /home/root

6) From /home/root I try running (over SSH) as follows ./HelloWorld

You mention that the shell may not be in the directory I think I am in?

Or it is no longer there?

How would I check this and what in my steps would cause this (again I can do a ls -all and see it with the correct permissions)?

I will try the -l ./HelloWorld

If this indicates it is there and has the correct permissions why can I not run it?

Is in due to your your last comment, where you mention that root's account is /root not /home/root.

So I would just need to run from /root instead of /home root?

Thanks again for your help!

Sorry one other thing.

I have also used PUTTY (SSH) and cd to /home/root and tried ./HelloWorld, so I believe I am in the right location.

Ok. The command "ls -l ./HelloWorld" should output the file name, ownership, and permissions. If it isn't there, you should get the error message "ls: cannot access ./HelloWorld: No such file or directory". If you do get the appropriate information, then post the output here.

You were right, it is NOT found. If I do the ls -all I see it.

What is going on? Did the scp not work?

root@(none):~# -l ./HelloWorld
-sh: -l: not found

root@(none):~# pwd
/home/root

root@(none):~# ls -all
drwxr-xr-x    4   1000   pulse    4096 Jan  1 2000 .
drwxr-xr-x    4   1000   pulse    4096 Aug 27 2014 ..
-rwxrwxrwx    1   root   root     4096 Sep 26 2014 HelloWorld

Just to add a few sanity checks:
Is the file named helloworld or HelloWorld? Case matters.
Can you run the file as /home/root/helloworld?

My other thoughts match rubberman's comments, check ownwership and rights.

Yeah I tried the /home/root/HelloWorld with the same result.

What specifically to I look at for ownership and rights?

I also tried the following:

uname -a -m -p
Linux (none) 3.2.0 #5 Wed Sept 10 18:06:00 CDT 2014 armv71 GNU/Linux
root@ (none):~# file HelloWorld
-sh: file: not found

If it is a permission thing (I take it permissions on the file system), how do I change it.

Is there an easy way to check the permissions on the filesystem?

Is the error indicative of a permission's problem => the SCP did not work do to the file system being read only?

You left off the command name which is "ls", as in ls -l ./HelloWorld

Thanks for all of the help.

The issue was in my makefile. I was pointing to an different cross-compiler version than the kernel, filesytem, etc. were built with.

It now works.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.