[Q] Commands via SSH - Galaxy Tab 10.1 Q&A, Help & Troubleshooting

Lately i got ssh running on my tablet and was not able to use commands that worked over adb.
The commands included "am boradcast" and "input tap"
Is this somehow planned or a bug.
I am using Cyanogenmod Nightly with OpenSSH

Tyrado said:
Lately i got ssh running on my tablet and was not able to use commands that worked over adb.
The commands included "am boradcast" and "input tap"
Is this somehow planned or a bug.
I am using Cyanogenmod Nightly with OpenSSH
Click to expand...
Click to collapse
Not sure and i'm not expirienced with SSH, but isn't there something else needed for ssh commands?
Did some research for you and thei're talking about an opensshd daemon, maybe this could help you further... (Trust me )
http://linux.about.com/od/commands/l/blcmdl8_sshd.htm

The ssh daemon is the peace of code running on my device, listening for connections. This is all working so far. I am able to connect but issuing the commands doesn't produce any output or effect

Related

How to ssh to my Hero

After installing MoDaCo ROM I found SSH password near the build version so I opened Putty terminal and tried to connect to my Hero's IP but it says connection refused. Should I launch SSD daemon somehow? (I tried to execute sshd in terminal but it was not found)
Thanks.
port 2222?
That's it! I used 22. Thanks a lot.

[Q] What's a good ssh server to run on the HOX+?

Any recommendations for a good ssh server to run on the phone? It's easier to me to run a shell, vi, scp via something like putty that works well as a real terminal than 'adb shell' via the command prompt where vi is all messed up, etc. I tried Android Commander as an alternative but it's too buggy at least against our phone.
So what is *the* ssh server to run on the phone with the option to keep it disabled most of the time, except when I need to use it?

Best remote shell alternative to adb shell?

What's a good approach for getting a remote shell from Windows? adb shell just doesn't cut it, I tried it from the Win command prompt and from cygwin's mintty and there are all sorts of terminal problems, cursor keys not working, escape sequences not working, vi is a mess, etc.
So what's the proper way to set up a remote shell so that you get close to the Linux experience while connecting from Windows? E.g. sshd and connect via putty, busybox installed, etc. Any recommendations please before I go and try a bunch of things and make a mess? Thanks!
sirxdroid said:
What's a good approach for getting a remote shell from Windows? adb shell just doesn't cut it, I tried it from the Win command prompt and from cygwin's mintty and there are all sorts of terminal problems, cursor keys not working, escape sequences not working, vi is a mess, etc.
So what's the proper way to set up a remote shell so that you get close to the Linux experience while connecting from Windows? E.g. sshd and connect via putty, busybox installed, etc. Any recommendations please before I go and try a bunch of things and make a mess? Thanks!
Click to expand...
Click to collapse
SSH is a good alternative. You can then connect via PUTTY from your Windos machine. There's a small ssh server for embedded system called "dropbear", alto not fully functional (no scp/sftp support), it's easier to install than openssh. If you don't want to install it in the Android OS native, you can always download an app including it, there's a few of them.
Myself I'm using openssh, using my fully GNU Debian environment (see my signature). This solution also enables me to use X-windows for remote access to my Android. But I guess this is overkill for you. But still, very cool.
kuisma said:
SSH is a good alternative. You can then connect via PUTTY from your Windos machine. There's a small ssh server for embedded system called "dropbear", alto not fully functional (no scp/sftp support), it's easier to install than openssh. If you don't want to install it in the Android OS native, you can always download an app including it, there's a few of them.
Myself I'm using openssh, using my fully GNU Debian environment (see my signature). This solution also enables me to use X-windows for remote access to my Android. But I guess this is overkill for you. But still, very cool.
Click to expand...
Click to collapse
Thanks! Your link Run a complete GNU/Linux distribution on your Android is pretty cool!
I tried DropBear SSH Server II and SSHDroid and they seem to work well enough for what I need. Next step is to get sftp working which apparently it is possible with DropBear SSH Server II with a bit of manual work.

ADB + Linux error: device unauthorized

Hi
First of all, sorry for my bad english.
It has been several hours that i'm trying to find a solution to my problem.
I want to wake my nvidia shield via adb command throught network.
I installed android tools on my raspberry pi, and when i connect to it via command line everything work, i can wake up the Shield.
But when i put my command line in a bash script
Code:
#!/bin/bash
adb kill-server
adb start-server
adb connect 192.168.1.38:5555
adb shell input keyevent KEYCODE_WAKEUP
adb kill-server
i have this error :
Code:
error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
I dont know why, when i am execute the command line in a bash script it can't find the rsa key, who is there and should be used.
Any ideas
Thanks in advance.
darkouz said:
Hi
First of all, sorry for my bad english.
It has been several hours that i'm trying to find a solution to my problem.
I want to wake my nvidia shield via adb command throught network.
I installed android tools on my raspberry pi, and when i connect to it via command line everything work, i can wake up the Shield.
But when i put my command line in a bash script
Code:
#!/bin/bash
adb kill-server
adb start-server
adb connect 192.168.1.38:5555
adb shell input keyevent KEYCODE_WAKEUP
adb kill-server
i have this error :
Code:
error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
I dont know why, when i am execute the command line in a bash script it can't find the rsa key, who is there and should be used.
Any ideas
Thanks in advance.
Click to expand...
Click to collapse
Normally on Windows the first time you turn on usb debugging it will pop up and ask you to accept the adb key. This is what is preventing you, I haven't had to resolve this in Linux, but essentially you need to go to C:\\Users\You\.android\ (in Windows, path will be different in Linux) and copy the file adbkey. Now you need to move it to data/misc/adb/
This will most likely require root or TWRP. Good luck, my friend.
Sent from my KYOCERA-C6745 using Tapatalk
Hi
Thanks for your quick response.
I couldn't make the connection via USB my adb tells me that there is no emulated device. But it work with network And yeah the first time I made the connection, the authorization pop up appeared on my shield. I checked, always authorized this device.
I have the key in /root/.android on my raspberry pi
I don't think I have the access to the /data/ folder in my shield.
But what I don't understand is why when I execute the command in a terminal like that, it work and when it's from the bash script it won't work anymore
darkouz said:
Hi
Thanks for your quick response.
I couldn't make the connection via USB my adb tells me that there is no emulated device. But it work with network And yeah the first time I made the connection, the authorization pop up appeared on my shield. I checked, always authorized this device.
I have the key in /root/.android on my raspberry pi
I don't think I have the access to the /data/ folder in my shield.
But what I don't understand is why when I execute the command in a terminal like that, it work and when it's from the bash script it won't work anymore
Click to expand...
Click to collapse
Option B would be to dump your boot.img and use Assayed's kitchen to add insecure kernel and adb direct root, then the adbkey doesn't need to be on the device.
Sent from my KYOCERA-C6745 using Tapatalk
RealWelder said:
Option B would be to dump your boot.img and use Assayed's kitchen to add insecure kernel and adb direct root, then the adbkey doesn't need to be on the device.
Sent from my KYOCERA-C6745 using Tapatalk
Click to expand...
Click to collapse
Yeah as you said in your previous post, i think the solution is to root the nvidia shield cause the rsa key doesny copy itself on the device.
But would you able to explain to me why if i execute those command individually in the terminal it works.
But if i put them all in a bash script that i execute it doesnt work anymore, what's the difference between those two procedure ?
darkouz said:
Yeah as you said in your previous post, i think the solution is to root the nvidia shield cause the rsa key doesny copy itself on the device.
But would you able to explain to me why if i execute those command individually in the terminal it works.
But if i put them all in a bash script that i execute it doesnt work anymore, what's the difference between those two procedure ?
Click to expand...
Click to collapse
How are you executing the script? There's some (hopefully) helpful info here.
https://community.spiceworks.com/topic/433656-command-not-running-in-batch-but-will-run-in-cmd
Sent from my KYOCERA-C6745 using Tapatalk
RealWelder said:
How are you executing the script? There's some (hopefully) helpful info here.
https://community.spiceworks.com/topic/433656-command-not-running-in-batch-but-will-run-in-cmd
Sent from my KYOCERA-C6745 using Tapatalk
Click to expand...
Click to collapse
i m doing : sh script.sh
i m gonna read that, thanks
I found the solution.
I don't really understand why, but adding
Code:
sleep 1
before
Code:
adb shell input keyevent KEYCODE_BACK
resolved the problem, maybe the script execution was to fast for adb to adjust, dont know.
All i know is, that works
darkouz said:
I found the solution.
I don't really understand why, but adding
Code:
sleep 1
before
Code:
adb shell input keyevent KEYCODE_BACK
resolved the problem, maybe the script execution was to fast for adb to adjust, dont know.
All i know is, that works
Click to expand...
Click to collapse
Glad you got it.
Sent from my KYOCERA-C6745 using Tapatalk
sudo rm -rf /home/(username)/.android
that worked with my kde neon machine

ConnectBot not working as expected

I recently installed ConnectBot and ran it. When the app opened, I typed 'ls', but was told 'permission denied'; however, I was able to successfully execute 'ls /sdcard' .
My phone is a rooted Pixel 7 running Android 13. What can I do, if anything, to see the / directory? Thanks.
groston said:
I recently installed ConnectBot and ran it. When the app opened, I typed 'ls', but was told 'permission denied'; however, I was able to successfully execute 'ls /sdcard' .
My phone is a rooted Pixel 7 running Android 13. What can I do, if anything, to see the / directory? Thanks.
Click to expand...
Click to collapse
I don't understand what you are writing about. ConnectBot is an ssh client. First you need to establish a connection. You can only execute commands after logging in.
ze7zez said:
I don't understand what you are writing about. ConnectBot is an ssh client. First you need to establish a connection. You can only execute commands after logging in.
Click to expand...
Click to collapse
I don't understand your reply. I set the program to localhost and when I entered 'ls /sdcard', it did exactly as expected. However, when I simply entered 'ls', I got an error.
So ConnectBot works great, but you write something completely different in the title of the thread (ConnectBot not working as expected).
.

Categories

Resources