#SSH doesn't work on my phone on ios 14

355 messages · Page 1 of 1 (latest)

lunar totem
#

when i try to ssh into my phone this is the error i get

lunar totem
glad trail
lunar totem
#

ios 14.5.1

glad trail
#

And is OpenSSH installed?

lunar totem
#

12 pro max

lunar totem
#

before it gave me a publickey error

glad trail
#

try a userspace reboot if you haven’t and connect again maybe?

lunar totem
#

if i have a very long uptime

#

would that have an effect

glad trail
#

It shouldn’t but the system can become somewhat unstable with time technically

lunar totem
#

same error after userspace reboot

glad trail
#

A full reboot might be better if your phone’s been on for like weeks

lunar totem
glad trail
#

has SSH ever worked in those 133 days

lunar totem
#

only wired ssh

#

when i plug it into my mac it works fine with ssh

#

second i try wireless

#

it refuses to connect

glad trail
#

it could be a configuration issue? not sure

strong temple
#

can you add -v to the ssh command to get a verbose output

lunar totem
lunar totem
#

like before you sent your message

strong temple
#

oh, are you trying to ssh to your pc from your phone?

lunar totem
#

im tryna ssh into my phone from my pc

#

i just tried with my other phone

#

with working ssh

strong temple
#

ahhh okay nvm then

#

hmm

#

see if this does anything

lunar totem
#

same error

strong temple
#

double check if sshd is actually running

#

ps aux | grep ssh

#

that's on the device

lunar totem
#

yeah ssh is running in mobile

strong temple
#

what happens if you try logging in as the mobile user instead of root?

lunar totem
#

same error

strong temple
#

shouldn't be an issue on 14 but it does matter in 15+

#

ah

lunar totem
strong temple
#

just ah as in i didn't think that would work anyway

glad trail
# lunar totem

/var/jb doesn’t sound right here to me personally for iOS 14 intjsad
Do these paths exist on the device?
Try to ls /var/jb/root/var/.ssh
I’m probably wrong

lunar totem
#

i dont see a jb folder in var

strong temple
#

oh i didn't even notice that

#

that is strange

lunar totem
#

oh god damn it

#

i mustve installed the rootless version

glad trail
#

Yeah

#

I was about to say

strong temple
#

what repos do you have added

lunar totem
glad trail
#

Make sure you’re downloading OpenSSH from Procursus

lunar totem
glad trail
#

That’s weird.

lunar totem
#

is this normal

glad trail
#

It should be? Looks correct to me

strong temple
#

no, wait

#

that error is reading the keys from the phone

#

i assume your other phone is jailbroken rootless

lunar totem
#

yes

strong temple
#

that's why it says /var/jb

#

so this isn't the issue

lunar totem
#

damn it

#

not even uninstalling openssl worked

strong temple
#

can try an even older algorithm i guess ssh -oKexAlgorithms=+diffie-hellman-group14-sha1 [email protected]

#

just double check if the ip is the same

#

and it hasn't changed on the phone

lunar totem
#

nope

#

didnt work

glad trail
#

default key algorithm should work since iOS 14 isn’t that old

lunar totem
#

should i send over my sshd_config file

glad trail
#

I have no clue what’s wrong there

Weirdly I had the same issue on an iPhone 5 I jailbroke with Socket recently

strong temple
#

might as well send it

lunar totem
lunar totem
#

how'd you fix it

#

or is it still broken

glad trail
lunar totem
strong temple
#

it's weird because the error you sent earlier implied ssh was working fine

strong temple
lunar totem
#

yeah after doing that i just get permission denied

strong temple
#

only thing i can think of is regenerating host keys via ssh-keygen -A then restarting sshd

lunar totem
#

like how do i restart sshd

#

uhh

strong temple
#

launchctl stop sshd

lunar totem
#

doing launchctl reboot sshd

#

just made my phone go black

#

oh thank god

#

thought i fucked it up

#

it just kernel panicked

strong temple
#

yeah launchctl reboot reboots the device lol

lunar totem
#

welp there goes the 133 day uptime

strong temple
#

might fix ssh not working thishowitis

#

maybe

lunar totem
#

god damn it

#

same error

lunar totem
#

oh nvm

strong temple
#

you shouldn't need to

lunar totem
#

same error

glad trail
#

Maybe start sshd in debug mode?

launchctl stop sshd
then
sshd -D

#

it should show debug logs and such as stuff tries to connect

glad trail
#

my bad

#

try

which sshd

then do /path/to/sshd -D

lunar totem
#

says no hostkey available

strong temple
#

this needs to be done on the ios 14 phone

lunar totem
glad trail
#

no that checks out

lunar totem
strong temple
#

oh i thought the 12 pro was the one jailbroken rootless

lunar totem
glad trail
#

ssh-keygen should have generated host keys though

strong temple
lunar totem
glad trail
#

Wait no I know the issue

glad trail
lunar totem
#

it did nothing now

glad trail
lunar totem
#

nothing

glad trail
#

same error or is sshd just not showing anything on the phone

glad trail
#

wtf

strong temple
#

to sanity check can you ssh from your pc to your rootless device

#

just use mobile as the user instead

lunar totem
#

yeah

strong temple
#

man

lunar totem
#

tf is this

strong temple
#

yeah that's normal, it happens the first time you open a terminal on jailbroken ios

lunar totem
#

oh

strong temple
#

1 gives you all of the zsh features but if you aren't using the terminal after this you can just q

lunar totem
strong temple
#

idk i'm gonna ping <@&355177530061357057> because there is so little documentation on ios ssh issues it would be worth trying to figure this out

lunar totem
#

oh ok

strong temple
#

situation: ios 14 device jailbroken with taurine, ssh refusing to connect

lunar totem
#

wow lots of people are responding

uneven carbon
#

have they tried a different network

lunar totem
#

yeah

#

ive tried my other internet

uneven carbon
cerulean maple
#

post the latest error please

lunar totem
strong temple
#

it's not a network or firewall error as they can connect to a rootless device

cerulean maple
#

do you want to use keys or do you want to use password auth

lunar totem
#

im fine with either

cerulean maple
#

hm

strong temple
# lunar totem

config is here but i think PubKeyAuthentication Yes is on

lunar totem
#

and when i turn it off

#

i get this error

cerulean maple
#

if you turn that off then you have no authentication methods

#

does the /etc/ssh/sshd_config.d/ folder exist

lunar totem
lunar totem
#

just sshd_config

cerulean maple
#

hm

#

can you upload it

lunar totem
cerulean maple
#

no changes from that?

lunar totem
#

but its on yes rn

strong temple
#

eh just upload the current one anyways

lunar totem
#

alr

cerulean maple
#

what happens if you try sshing into mobile

lunar totem
#

same error

#

any ideas on what to try?

cerulean maple
#

can you run with -vvv

#

basically trying to see if the server ever offers password auth

lunar totem
#

wait did my screenshots send

dreamy dock
#

they got shot down by mrbeast buster

#

don't send 4 screenshots at a time

lunar totem
#

oh

cerulean maple
#

ffs

#

ok uh

#

you wanna take the easy way out or do you wanna fix password auth

lunar totem
#

since if anyone else has this issue

#

there will be people able to find a solution easier

cerulean maple
#

thats fair

#

lets do two things

  1. enable logging to file
  2. change logging level to debug
#

for 1. let's find out where the launch daemon plist is

cerulean maple
#

i assume you have a terminal app installed

lunar totem
cerulean maple
#

aight

#

grep -rF sshd /System/Library/LaunchDaemons /Library/LaunchDaemons

#

it should be in one of these places

lunar totem
cerulean maple
#

nice

#

so it's the one in /Library/LaunchDaemons/com.openssh.sshd.plist

#

open that up

lunar totem
cerulean maple
#

tbh whatever is easier for you we're gonna edit the file

lunar totem
#

filza it is

cerulean maple
#

so in the program arguments list, at the end we shall add

#

hm

#

lets put it in tmp

#
-E
/tmp/sshd.log
#

-E is one item

#

the path is another item

lunar totem
cerulean maple
#

yea so Item 3 is -E and Item 4 is the file path

lunar totem
#

like this right?

cerulean maple
#

yea

#

save and exit

lunar totem
#

alr

cerulean maple
#

step 2 is easy
in sshd_config change the LogLevel from INFO to DEBUG

#

step 3 userspace reboot

#

then try connecting again, and after it fails, check /tmp for the log

lunar totem
#

says permission denied

cerulean maple
#

the log file?

lunar totem
cerulean maple
#

are you grabbing it from filza or?

lunar totem
#

yes

lunar totem
cerulean maple
#

try copying it from terminal

#
sudo chown mobile:mobile /var/mobile/sshd.log

remove sudo if your terminal is logged in as root

lunar totem
#

wait

#

i have it in my notes app

#

lemme grab my mac rq so i can send it

cerulean maple
#

wtf

#

try DEBUG3 for log level

lunar totem
#

oh ok

lunar totem
cerulean maple
#

if you don't see debug3 in logs after trying to connect again, do a userspace reboot

lunar totem
#

i see debug3

#

also im going to the apple store in a bit

#

since i have to fix a seperate thing

cerulean maple
#

its ok im honestly out of ideas

lunar totem
#

oh ok

cerulean maple
#

maybe completely uninstall and reinstall openssh-server or something

#

or restore rootfs

lunar totem
cerulean maple
#

worst case just use pub key auth

lunar totem
cerulean maple
#

there should be a file like this but called id_rsa.pub, copy this to /var/root/.ssh/authorized_keys

#

for pub key auth

cerulean maple
#

oh

#

you'll need to make an ssh key then

#

github has a tutorial for it, i've gotta go do some other work

cerulean maple
#

that works

lunar totem
#

ok

#

what about ssh for my mac

#

do i also generate keys?

cerulean maple
#

you can use the same keys or you can generate new ones

lunar totem
#

oh ok

cerulean maple
#

if you use the same keys, copy id_ed25519 and id_ed25519.pub to ~/.ssh on mac

cerulean maple
#

make one

lunar totem
#

alr

cerulean maple
#

you'll need to set the perms on it to 600 or something

#

chmod 600 /var/root/.ssh/authorized_keys should work

lunar totem
#

how do i do that?

cerulean maple
#

you can also do it with filza
r/w on owner, nothing on group and everyone

#

its been a while so i forgot what the filza ui looks for it honestly

lunar totem
#

or just authorized_keys

cerulean maple
#

maybe r/w/x (700) on the .ssh folder itself

lunar totem
#

mask says 700

#

so i think i did it

#

and same error after adding public keys

lunar totem
cerulean maple
#

still pubkey denied?

lunar totem
#

yeah

cerulean maple
#

are you doing root user or mobile user

#

make sure its root

lunar totem
#

root

cerulean maple
#

oh

lunar totem
cerulean maple
#

no

#

/var/root/.ssh/authorized_keys is a file

cerulean maple
#

inside is the contents of id_ed25519.pub

#

its basically a list of all the (public) keys allowed to ssh

lunar totem
cerulean maple
#

shouldnt need to

lunar totem
#

and its still not working

#

yay

cerulean maple
#

id_ed25519 exists in c:/users/something/.ssh?

lunar totem
#

yes

cerulean maple
#

can you get the output of ssh -v again

#

wanna make sure its using it

lunar totem
cerulean maple
#

hm

#

did you set the perms on authorized_keys?

#

should be 600

lunar totem
cerulean maple
#

check the sshd log

#

but other than that im out of ideas

lunar totem
#

@cerulean maple

cerulean maple
#
Authentication refused: bad ownership or modes for file /private/var/root/.ssh/authorized_keys
debug3: Ignored authorized keys: bad ownership or modes for file /private/var/root/.ssh/authorized_keys
d```
#

can you check in terminal?

#

ls -lsall /private/var/root/.ssh/authorized_keys

cerulean maple
lunar totem
cerulean maple
#

ah

#

change to root and wheel, respectively

lunar totem
cerulean maple
#

technically supposed to be wheel, but also works

lunar totem
#

oh ok

#

thanks

cerulean maple