How to use SSH on iPhone - ios

I am trying to create an iPhone app that connects to a Linux machine. The app should send a command via SSH to the Linux machine. I am using system("ssh david#192.xxx.x.xx gpio write 0 0" but this command doesn't include a password, so the log response is access denied. Does anyone know how to SSH into a Linux machine with a password?

The only way to achieve what you want on not Jailbroken devices is to use a lib like http://www.libssh.org to implement a ssh login within your App.
You can find examples on how to implement it there : http://api.libssh.org/master/libssh_tutor_guided_tour.html

Related

how to get SSH access over the internet without SSH access?

ok that sounds weird I know. however, my Raspberry Pi server was connected to Tailscale and I was able to do everything, however I installed and removed Pi hole and when i removed something called "iproute2" I lost connection to tailscale. however I still can access stuff such as portainer and any docker app through Cloudflare. now is there anyway to access my ssh again? is there any docker app that allows me send commands or so? all I need is either to send "sudo ngrok tcp 22" or "tailscale up",, thanks

Remote connection using SwiftNIO SSH

I am working on a solution that would Read/Write Server files from remote gateway system to the local storage of iOS device using SwiftNIO SSH. This way I would be able to execute shell commands. I checked in Swift's website but couldn't find specific implementation:
https://swift.org/blog/swiftnio-ssh/
How should I proceed or is there any other workaround?
The implementation is here: https://github.com/apple/swift-nio-ssh. There are some examples in the repository.

How to login using ssh without any sort of authentication?

I have seen similar questions, but nothing helped.
Like here:
SSH login with no authentication
SSH session without ANY authentication
My problem is as the question states. I want to setup ssh to work without any password prompt or any keys. Means, doing
ssh computer#IP_address
should give me access to the remote machine.
Question ends here^^^^^^^^^^^. Details of what I'm trying to achieve:
I have a docker image of Ubuntu in which I'm trying to install ssh. This has 2 reasons: easy file transfer using scp and the other is, that I sometimes, by mistake I close docker without committing and end up losing all my progress/data. So I want to make it such that I run the docker container in the background and only access it using ssh. Also, I am working in a team and I'll need to some other outside people(who download my docker image) to be able to work with it easily as well, which is why I want it to be ssh-accessible without a login.
You should look at setting PermitEmptyPasswords to yes in your sshd_config file and restard sshd service.
PermitEmptyPasswords
When password authentication is allowed, it specifies whether the server allows login to accounts with empty password strings. The default is ''no''.

Running jupyter notebook from web server on ipad localhost

I'm using Blink on my iPad Pro to SSH to my DigitalOcean Ubuntu web server and run Jupyter Notebook.
I can SSH just fine, and can run Jupyter Notebook fine as well. I get the usual Jupyter Notebook url http://localhost:8888/?token-12345 but when copy-pasting this url in my chrome browser on my iPad, I get he error message 'this site can't be reached'.
Anyone knows how to fix that? Is SSH tunnelling part of the solution? What command(s) should I run?
There are multiple ways to do that:
SSH tunnel / port forwarding. You may need a standalone app to establish a tunnel (this one, for example), and then connect to your server in browser using localhost and mapped port.
Public server. You can make your server accessible publicly (more details here), but beware that you may also need to configure a valid SSL certificate to connect to your server via HTTPS, or otherwise Jupyter's kernel will not be able to connect in any iOS browser. Here is a step-by-step guide on how to configure a self-signed certificate that will work on iPad: https://juno.sh/ssl-self-signed-cert/
Finally, once you get it working in Chrome/Safari, you may consider using an app that I've developed instead of browser, it's called Juno and it's a Jupyter Notebook client for iPad: https://itunes.apple.com/app/juno-jupyter-notebook-client/id1315744137
It does require an in-app purchase to connect to an arbitrary server, but you can launch a bunch of introductory notebooks for free out of the box, without any configuration.

scp files through gateway to remote machine

I can't figure out how to scp a file to another machine if there is a gateway connecting my client machine to the remote server. From my client machine I can connect to both the gateway and subsequently to the remote server using SSH without any problems.
When I try to scp my directory dir to the remote server I have no clue how to move past the gateway, because my ssh connection is actually an two-step approach. Scp'ing dir to the gateway first fails, with the remark "Permission denied".
Something like
~$: scp -r /var/www/dir usrname#remotesrv.com:/var/www/dircp
doesn't work and the only approach I found so far involves public/private keys. Is it only possible to copy files through a gateway with keys? And if that's so, can somebody tell me how to overcome the problem with copy&pasting into the terminal which sometimes just won't work (using Ubuntu 11.10). Already installed autokey hoping to circumvent buggy Ubuntu shortcuts by changing them to another hotkey, but the program is crashing all the time.
I would appreciate your help in one way or another!

Resources