115 posts / 0 new / Last post
  July 31, 2012 - 9:08pm (Reply to #61)
Dota's picture
Offline
Joined: Jul 2012
Posts: 20
Kudos: 0
  alex_guichard wrote:

Hi all.  New to the boards - this discussion caught my eye. Thanks for the instructions for downgrading, it does not seem to be working for me unfortunately.    

 

I copied the .deb file to the apple TV with iFunBox, modified the startup file. When I get on the apple TV and highlight 'openssh' in NitoTV's "Install Software" screen, it says I have the older ssh version installed (5.8p1-9), but when I click "select" to go to the install/queue/remove/more screen for OpenSSH, it says I have 6.0p1-10 installed. The deb file is still there in the autoinstall folder when I power down and plug the appleTV back into iFunbox.

Do you think I am not properly downgrading? All I modified in the startup file was to add "--force-downgrade" to the dpkg line, am I missing other code in there?  Also, I edited it in notepad (my windows HTPC does not have a great text editor on it), is there a better text editor on windows I should use?

 

This the exact same error I'm running into.  Even with the "/tmp/dpkg.log" a log file should at least be produced and that's not even happening.  I went even as far as deleting all the openssh6.0 versions found and that still didn't work.

  August 1, 2012 - 2:48am
Kev Wicks's picture
Offline
Joined: Jul 2012
Posts: 2
Kudos: 0

OK were all pretty experienced at this so the jailbreak is clearly not working FINAL

I take it we all had the firecore logo on our ATV menu....

so lets be honest, firecore have messed things up...

.otherwise we would all be CAPABLE to ssh ....

Confused

  August 1, 2012 - 9:26pm
natzc's picture
Offline
Joined: Jan 2012
Posts: 1
Kudos: 0

Hey,

I recently just updated to 5.01 from 4.4 and experienced the same problem. No ping, SSH, and aTV Flash wasn't able to find an Apple TV on my network.

Anyway, long story short it was a setting on my router "The WLAN devices displayed may communicate with each other". When I enabled this it worked straight away.

Not sure if there any other routers out there with a setting similar to this,  but maybe have a look for something as it wasn't a stand out feature. It was only until I came to the realization that I upgraded my router after I originally jailbroke the atv and only wanted to use AirPlay for the first time today that I went looking.

Router is a Fritz!Box 7390 and I hope this may help others.

  August 2, 2012 - 8:59pm (Reply to #64)
badabing's picture
Offline
Joined: Jun 2012
Posts: 22
Kudos: 0
  alex_guichard wrote:

Hi all. New to the boards - this discussion caught my eye. Thanks for the instructions for downgrading, it does not seem to be working for me unfortunately.

I copied the .deb file to the apple TV with iFunBox, modified the startup file. When I get on the apple TV and highlight 'openssh' in NitoTV's "Install Software" screen, it says I have the older ssh version installed (5.8p1-9), but when I click "select" to go to the install/queue/remove/more screen for OpenSSH, it says I have 6.0p1-10 installed. The deb file is still there in the autoinstall folder when I power down and plug the appleTV back into iFunbox.

Do you think I am not properly downgrading? All I modified in the startup file was to add "--force-downgrade" to the dpkg line, am I missing other code in there? Also, I edited it in notepad (my windows HTPC does not have a great text editor on it), is there a better text editor on windows I should use?

Any help you can provide is much appreciated! Really missing being able to remote in to my AppleTV!

Another interesting note: when I log into my router, the appleTV is not showing up in my DHCP client table -- even though it is connecting to the network and the internet just fine. Strange.

Hi alex_guichard / Dota, I suspect that notepad messed up your file.
EOL (end of line) is not the same on windows and Unix, and notepad blindly converts it into windows format, which when copied back to ATV wouldn't work.

What you have to do is download Notepad++ or similar text editor that retains the file format, or in your case converts it back to Unix.

load the file in Notepad++ and do
Edit | EOL Conversion | Unix Format
Save
transfer it again to ATV
make sure the file permissions have execute flag
and while you're at it, make sure the deb file has read / write permissions properly set.

if AutoInstall works, the deb file should not be there anymore

As for the ATV not showing up in the DHCP client table, if you can reach ATV at the expected IP, then the problem is with the router not properly displaying the DHCP registrations, unless of course you set your ATV to static IP, in which case you shouldn't see it in the router's DHCP clients table.

natzc,
if you can't ping ATV, then the issue is not the same as this thread's "ssh connection closed"
which you already have figured out correctly.

  August 2, 2012 - 10:03pm
Dota's picture
Offline
Joined: Jul 2012
Posts: 20
Kudos: 0

:(  ... still giving the same error after saving in UNIX format using Notepad++.  Is there a certain encoding the file must be (right now mines is set to UTF-8)?  Only difference was a pkginfo file was created in the /tmp directory showing that openssh_6.0p1-10 was installed.  Crazy part about it, I can't even find the openssh_6.0p1-10 file on my atv.  So where did it install that file at?

  August 3, 2012 - 11:28am (Reply to #66)
badabing's picture
Offline
Joined: Jun 2012
Posts: 22
Kudos: 0
  Dota wrote:

:(  ... still giving the same error after saving in UNIX format using Notepad++.  Is there a certain encoding the file must be (right now mines is set to UTF-8)?  Only difference was a pkginfo file was created in the /tmp directory showing that openssh_6.0p1-10 was installed.  Crazy part about it, I can't even find the openssh_6.0p1-10 file on my atv.  So where did it install that file at?

Dota,
Is the deb file still in the AutoInstall directory? or is it being removed?

if you check the following file contents
/private/var/lib/dpkg/status

and search for openssh, you should see what version is installed.

/private/var/lib/dpkg/info/openssh.list
will list all the components of that package.
which should be this for openssh 6.0p1-10

[code]
/usr
/usr/bin
/usr/bin/ssh-agent
/usr/bin/ssh-add
/usr/bin/ssh-keygen
/usr/bin/ssh-keyscan
/usr/bin/scp
/usr/bin/ssh
/usr/bin/sftp
/usr/sbin
/usr/sbin/sshd
/usr/libexec
/usr/libexec/ssh-pkcs11-helper
/usr/libexec/sshd-keygen-wrapper
/usr/libexec/ssh-keysign
/usr/libexec/sftp-server
/Library
/Library/LaunchDaemons
/Library/LaunchDaemons/com.openssh.sshd.plist
/var
/var/empty
/etc
/etc/ssh
/etc/ssh/ssh_config
/etc/ssh/sshd_config
/etc/ssh/moduli
/usr/bin/slogin
[/code]

could you get all these files onto your pc and zip them up and post?
I want to compare them to the stock openssh 6.0p1-10 and see what has been changed.
I suspect either the config files or plist file, but if you could post them all, we should be in a position to identify the change and just correct that instead of this path of downgrade and then upgrade.

i wish I had done that when my system had this issue, but that's too late for me.

  August 3, 2012 - 9:21pm
alex_guichard's picture
Offline
Joined: Jul 2012
Posts: 3
Kudos: 0

I edited the file in Smultron on my mac, making sure I set it to Unix (LF) end of line settings, I did not change the test encoding settings.  I re-uploaded it and still no dice.  How big should the .deb file be?  In my searching, I have found two different file sizes, many are around 400 k, and one is around 4 k.  Where is a reliable place to get that file? 

Trying to set/verify the permissions via iFunBox is not possible, I keep getting an ssh error message, saying port 22 is not found -- yeah, no kidding!  

This is really frustrating, but thank you for your help!

  August 3, 2012 - 9:50pm (Reply to #68)
Dota's picture
Offline
Joined: Jul 2012
Posts: 20
Kudos: 0
  badabing wrote:

Dota,
Is the deb file still in the AutoInstall directory?

yes

 

  badabing wrote:

if you check the following file contents
/private/var/lib/dpkg/status

and search for openssh, you should see what version is installed.

openssh 6.0p1-10

 

  badabing wrote:

could you get all these files onto your pc and zip them up and post?
I want to compare them to the stock openssh 6.0p1-10 and see what has been changed.
I suspect either the config files or plist file, but if you could post them all, we should be in a position to identify the change and just correct that instead of this path of downgrade and then upgrade.

i wish I had done that when my system had this issue, but that's too late for me.

Here's a link to my files that I put in a zip file...

http://www.qfpost.com/file/d?g=cewIG78hD

  August 4, 2012 - 7:37am
badabing's picture
Offline
Joined: Jun 2012
Posts: 22
Kudos: 0

Dota,
Just to be certain,
the files you uploaded, did you pick up a deb file or did you actually pick up the unpacked components from your ATV which I listed above?
I need the unpacked components just so I can validate them against stock oppenssh.
I see that you have upoloaded a deb file, and I doubt that your prepared a deb from from unpacked/installed files.

The deb file is a good file, and I don't expect it not to be, but the installed (unpacked files) that's another story.

alex_guichard,
be patient, when I get the files from Dota (you could do the same if you want) we'll nail this problem.

  August 4, 2012 - 7:48am
badabing's picture
Offline
Joined: Jun 2012
Posts: 22
Kudos: 0

alex_guichard,
by an y chance?
did you delete the startup in /private/var/stash/libexec/cydia and then copy back your edited version from PC,
that potentially would have reset the execute permissions on the file
edit the version on your pc and add the following line at the end
touch /mnt/test

if ifunbox allows you duplicate or copy a file from ATV to ATV (haven't looked into that)
then you can copy any other file in that directory, let's say du.
to startup, and then overwrite with your pc.
copying du to startup will create a startup file with the correct permissions but with du contents, and then overwriting with startup from your PC, it will change the contents but keep the correct file permissions.

You can give this a try,
then you can go and see if after reboot, you have a file in /mnt/test
that would indicate that startup executed properly.
if there is no test file in /mnt, then startup is not executing.

Good luck

  August 4, 2012 - 7:49am (Reply to #71)
Dota's picture
Offline
Joined: Jul 2012
Posts: 20
Kudos: 0
  badabing wrote:

Dota,
Just to be certain,
the files you uploaded, did you pick up a deb file or did you actually pick up the unpacked components from your ATV which I listed above?
I need the unpacked components just so I can validate them against stock oppenssh.
I see that you have upoloaded a deb file, and I doubt that your prepared a deb from from unpacked/installed files.

The deb file is a good file, and I don't expect it not to be, but the installed (unpacked files) that's another story.

alex_guichard,
be patient, when I get the files from Dota (you could do the same if you want) we'll nail this problem.

I picked the wrong openssh file to create the zip (picked the deb instead of the list).  Please see the new link...

http://www.qfpost.com/file/d?g=MYwohKrTS

  August 4, 2012 - 8:09am
Dota's picture
Offline
Joined: Jul 2012
Posts: 20
Kudos: 0

Badabing, what you said to alex, I'm curious about that also as I was not able to change permissions to the file and got the same error also.  I don't have a 2nd apple tv available though.

  August 5, 2012 - 7:10am
badabing's picture
Offline
Joined: Jun 2012
Posts: 22
Kudos: 0

Sorry Dota, my bad for not being too clear.
For the upload what I need is every file (ignore directories) on the list that you attached.
for example the first entry is:
[code]/usr/bin/ssh-agent[/code]
the second file I need is:
[code]/usr/bin/ssh-add[/code]

... all of them (there should be 19 files in total)

As for the alternate approach I suggested above, I didn't mean two ATVs, what I meant was a way to duplicate files on ATV using ifunbox.
I have looked into that but found that you can duplicate file, or even copy from one directory to another, it just moves.

But we can still try something different.
we know that ssh is broken, and I'm hoping that [code]/usr/bin/ssh[/code] file on your ATV is the proper permissions (normally it should, but can't confirm on a broken system)

connect with iFunbox
expand the folder: [code]Raw File System/usr/bin[/code]
expand the folder: [code]Raw File System/private/var/stash/libexec/cydia[/code]
drag [code]ssh[/code] from [code]/usr/bin[/code] into [code]/private/var/stash/libexec/cydia[/code]
rename [code]ssh[/code] to [code]startup[/code]
do not delete
now copy over the edited [code]startup[/code] file from your pc to ATV
this should replace it, but keep the permissions.

PS: I prefer if you first grab the files above before trying this approach, as that potentially could provide us a simpler fix that others can benefit from.

Good luck

  August 5, 2012 - 6:45pm
Dota's picture
Offline
Joined: Jul 2012
Posts: 20
Kudos: 0

Sorry about that bada, here's a copy of the asked for files...

 

http://www.qfpost.com/file/d?g=gCCeaEnmH

 

Only notes are the "var/empty" directory did not have anything in it and slogin was size zero.

  August 5, 2012 - 8:22pm
badabing's picture
Offline
Joined: Jun 2012
Posts: 22
Kudos: 0

Dota,
Thanks

Found the problem, corrupt [b] sshd[/b]
looks like the header has been replaced with libpcreposix dylib,

just replace it with the following file, reboot and you should be good to go.
http://www.qfpost.com/file/d?g=rn6CgCM9x

The file is in: /usr/sbin

Make sure you don't delete the one on ATV, just replace it so that you keep the permissions.
Good luck

  August 5, 2012 - 10:20pm
Dota's picture
Offline
Joined: Jul 2012
Posts: 20
Kudos: 0

failure still.  at this point I might as well re-jailbreak...can somebody guide me to the thread of saving my xbmc settings offline so I can import them back?

  August 6, 2012 - 11:10am
badabing's picture
Offline
Joined: Jun 2012
Posts: 22
Kudos: 0

Sorry to hear that, you did reboot right?
and ssh was not moved to do the startup trick right?

For xbmc, you need to backup
[code]/private/var/mobile/Library/Preferences/XBMC[/code]

after restoring the files, you need to make sure the permissions are for mobile user not root
[code]chown -R mobile.mobile /var/mobile/Library/Preferences/XBMC[/code]

  August 6, 2012 - 4:14pm
badabing's picture
Offline
Joined: Jun 2012
Posts: 22
Kudos: 0

Dota,

Just for kicks, I replaced my good [code]/usr/sbin/ssh[/code] with your bad sshd
rebooted and got the exact original error.
[b]Server unexpectedly closed network connection[/b]

replaced [code]/usr/sbin/ssd[/code] with the good sshd I posted above, didn't even needed to reboot, and I was able to connect again.

So most likely the real problem is a corrupted sshd.

In your case there might be other issues outside the sshd.
Can you ping your ATV?
What is the error message you are seeing? and have you rebooted?
Is [code]ssh[/code] not [code]sshd[/code] still intact?

Others who have this problem, can you check if replacing [code]sshd[/code] fixes your issue?

  August 6, 2012 - 6:21pm
Dota's picture
Offline
Joined: Jul 2012
Posts: 20
Kudos: 0

Hey bada, I can ping my apple tv from the command prompt.  I tried pinging www.yahoo.com right before just to check.  All packets were sent/received.

As far as ssh file goes, I have a ssh file of size 318KB in the /usr/bin and /var/stash/bin directory with a date/timestamp of 05/15/2012  05:20.

Then there are multiple ssh files of size zero in the /urs/lib/apt/methods and then repeats in the /usr/lib/_ncurses/apt/methods.  After that an additional _ncurses directory is added repeating multiple times.  _ncurses is a symbolic link folder.

  August 7, 2012 - 1:06pm (Reply to #80)
badabing's picture
Offline
Joined: Jun 2012
Posts: 22
Kudos: 0
  Dota wrote:

Hey bada, I can ping my apple tv from the command prompt.  I tried pinging www.yahoo.com right before just to check.  All packets were sent/received.

As far as ssh file goes, I have a ssh file of size 318KB in the /usr/bin and /var/stash/bin directory with a date/timestamp of 05/15/2012  05:20.

Then there are multiple ssh files of size zero in the /urs/lib/apt/methods and then repeats in the /usr/lib/_ncurses/apt/methods.  After that an additional _ncurses directory is added repeating multiple times.  _ncurses is a symbolic link folder.

Dota,
[code]/var/stash/bin[/code] is ok which is a symbolic link to /usr/bin
[code]
/usr/bin -> ../var/stash/bin/[/code]

However in /usr/lib/apt/methods
my ssh is a symbolic link to rsh (you do have rsh in that dir right?)
[code]ssh -> rsh[/code]
so perhaps you can delete all the copies of ssh in that dir and copy rsh to ssh
and don't worry about _ncurses dir either, that's another link
[code] _ncurses -> /usr/lib/[/code]

can you also confirm what error message you get when you run ssh connection?

  August 7, 2012 - 6:17pm
Dota's picture
Offline
Joined: Jul 2012
Posts: 20
Kudos: 0

I did have the rsh file in that directory

 

The error message I'm getting is "Putty Fatal Error:  Server Unexpectly closed network connection"

  August 8, 2012 - 9:47pm
badabing's picture
Offline
Joined: Jun 2012
Posts: 22
Kudos: 0

Not sure what to tell you Dota,
Other than grab the sshd from ATV and see if it binary matches the one I uploaded.
if they do, there must be something else not working on your system, you did reboot after replacing sshd right?
and it was replaced not deleted and copied right (asking this to make sure it has execute permissions)

by the way, if you install vsftpd, then you won't need to use ifunbox, you'd use any ftp client,

to get vsftpd working, you have to create an empty (named empty) directory in /usr/share
so you'd have a directory
[code]/usr/share/empty[/code]
and with ftp you'd be able to change the file permissions.

Good luck

  August 13, 2012 - 2:40pm
Jay-Jay's picture
Offline
Joined: Aug 2012
Posts: 3
Kudos: 0

I also have this annoying problem. I tried to jailbreak my ATV to get rid fix the problem but it didn't take many days before it reappeared. Badabing I am really impressed that you are taking the time to try and help the rest of us and I have tried your suggestion of replacing the sshd file. Unfortunately it didn't work for me. (I am not sure what you mean by replacing the file but I copied it to my ATV with iFunbox.) As you suggested I also installed vsftpd to be able to check file permissions but I haven't found any way to access the root directory of ATV through FTP as it seems I am jailed in some other directory even when logging in as root. I am now leaning towards the downgrade-upgrade solution which was peresented earlier but since I don't know where to find the previous openssh deb package I don't know how to proceed. The last thing I want do is to screw things up even more and since there seems to be a few different files out there I don't want to take any chances. Badabing, would you mind posting the deb package that you have been using or perhaps a link to where you found it? I would be very grateful if you could. If you have some other ideas I can also give them a try. Thanks!

  August 13, 2012 - 4:54pm
james's picture
Staff
Offline
Joined: Jun 2008
Posts: 14,100
Kudos: 1,207

[Moved to the Other Plugins section]

Infuse 6 for iOS and Apple TV is now available!

  August 14, 2012 - 1:07pm (Reply to #85)
badabing's picture
Offline
Joined: Jun 2012
Posts: 22
Kudos: 0
  Jay-Jay wrote:

I also have this annoying problem. I tried to jailbreak my ATV to get rid fix the problem but it didn't take many days before it reappeared. Badabing I am really impressed that you are taking the time to try and help the rest of us and I have tried your suggestion of replacing the sshd file. Unfortunately it didn't work for me. (I am not sure what you mean by replacing the file but I copied it to my ATV with iFunbox.) As you suggested I also installed vsftpd to be able to check file permissions but I haven't found any way to access the root directory of ATV through FTP as it seems I am jailed in some other directory even when logging in as root. I am now leaning towards the downgrade-upgrade solution which was peresented earlier but since I don't know where to find the previous openssh deb package I don't know how to proceed. The last thing I want do is to screw things up even more and since there seems to be a few different files out there I don't want to take any chances. Badabing, would you mind posting the deb package that you have been using or perhaps a link to where you found it? I would be very grateful if you could. If you have some other ideas I can also give them a try. Thanks!

Sure Jay-Jay,
here's the one I used.
http://www.qfpost.com/file/d?g=peBdScyZF

Sorry to hear that replacing sshd didn't work for you.
Perhaps there are more corruption other than just sshd.
I'd be curious to see your files and check them against stock, see notes to Dota on how to get them.

What I meant by replacing the file is to make sure not to delete the ATV copy before copying the good one over, that's because if you do so, you might lose the file execute permissions on the file.
keep the bad one there and overwriting with the good one will retain the file permissions, though won't guarantee the replacement succeeded.

if you already did it that way, try deleting first and then copying, just in case the file replace wasn't working, but make sure you check the file execute permission after doing so.

As for ftp, I use filezilla as the client, and don't have any issues accessing the root directory, give that a shot if you haven't already.

Good luck

  August 14, 2012 - 7:50pm
Dota's picture
Offline
Joined: Jul 2012
Posts: 20
Kudos: 0

Hey Bada I completely thank you for all your help, I'll just live with the ftp with filezilla.  Actually got that working

  August 15, 2012 - 2:07pm (Reply to #87)
Jay-Jay's picture
Offline
Joined: Aug 2012
Posts: 3
Kudos: 0

This is really super. Your workaround to install an old version and reinstallning the new openSSH worked like a charm, will keep this file around if the problem reappears. Also your suggestion to use Filezilla made it possible for me to access the root directory of the ATV through FTP.

I will send you a PM with the link to the problematic SSH files from my ATV, in case you want to dig deeper into the problem.

BTW, is there some way to report this bug to the developers so that they can avoid it in future releases. I also wish that nitoTV would allow users to remove (or at least reinstall) required packages directly from the GUI. This is the second time I have had to do this in order to get my ATV working again. This time it was more tricky since it was SSH that had stopped working...

Once again Badabing, a big thank you.

  August 15, 2012 - 9:48pm
Dota's picture
Offline
Joined: Jul 2012
Posts: 20
Kudos: 0

Hey bada, I think I'm attempting one more time since I have ftp to change file permissions.  I did a test with the startup file with the "touch /mnt/test" line at the end.  Saved the file and had permissions set at 755.  When reboot, there is not a test directory created under /mnt.  I suspect that the startup may not be working correctly but don't know how to proceed.

  August 17, 2012 - 6:36am
badabing's picture
Offline
Joined: Jun 2012
Posts: 22
Kudos: 0

Dota,
Happy to hear that filezilla did the trick Smile

Jay-jay,
got your files, and I see that the only corruption is in sshd and nothing else.
what I also noticed is that your package did not include
[code]/usr/bin/slogin[/code]
which happens to be a link to [code]/usr/bin/ssh[/code] (in fact a relative link [code]./ssh[/code])
can you check if you have a link for file named slogin? (perhaps it is too late as you already fixed the issue)
if the link is missing, than that could be a definite problem in addition to the corrupted sshd (your corruption matched dota's files)
if possible, please also check if /var/empty directory exists, I suppose it does, but just to be certain.
I don't know the logistics of informing developers with this issue, perhaps someone else can address that question.

Dota,
See my comments to Jay-Jay, it could apply to you too.
For the startup issue
See if you have the following file.
[code]/System/Library/LaunchDaemons/com.saurik.Cydia.Startup.plist[/code]

that's the one that initiates the startup script.

  August 17, 2012 - 1:51pm
Jay-Jay's picture
Offline
Joined: Aug 2012
Posts: 3
Kudos: 0

Badabing,
This is a mystery, I believe that slogin was a link to the ssh file since its file size was identical to one of the ssh file when I compared them in FileZilla, but I did not explicitly check if it was a link.

Maybe the reason why I had no luck replacing the sshd file was because of ownership or file permissons for this file, perhaps I did not copy it in the right way.