maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Need help cleaning up OpenSSH server install. (https://talk.maemo.org/showthread.php?t=40344)

Laughingstok 2010-01-13 15:45

Need help cleaning up OpenSSH server install.
 
So I was installing OpenSSH server on my N900.. made it past the point of it asking me for a new root password.

Then I dropped my phone, the back flew off and the battery came out. :(

The N900 started up fine again, but the openssh server does not work (I expected that to happen since it never truly finished installed)

I can "uninstall" it fine from the app-manager, then attempt to reinstall it. When I do, it tells me the installation fails, but it appears yet again in my uninstall list. Upon attempting to ssh to the n900 (localhost) it fails to connect, so it's not working.

Any ideas or help on how I can clean up this botched install and start clean with it?

Bec 2010-01-13 16:56

Re: Need help cleaning up OpenSSH server install.
 
There are 3 installers in the repos. I had a simmilar issue and I managed to get rid of it by playing with those.

Dunno if this will help but give it a try.

fatalsaint 2010-01-13 17:04

Re: Need help cleaning up OpenSSH server install.
 
Is there anything in Application Manager logs?

or the output of "apt-get install openssh-server"?

Elhana 2010-01-13 17:06

Re: Need help cleaning up OpenSSH server install.
 
Root password needed so you could login, not for it to work. For example I use rsa auth instead.

Quote:

Originally Posted by Laughingstok (Post 468582)
Upon attempting to ssh to the n900 (localhost) it fails to connect

This line worries me, how exactly are you trying to connect? Because connecting to localhost from another machine is wrong.

Also it might be because sshd is not started after installing package, reboot device or run this
Code:

/etc/init.d/ssh start

Spenc3 2010-01-13 17:20

Re: Need help cleaning up OpenSSH server install.
 
have you try cleaning the install??
i.e. sudo apt-get remove --purge openssh-server in xTerm?

Hopefully that will bring it back to a state where you can start off scratch again.

mikhmv 2010-01-13 17:36

Re: Need help cleaning up OpenSSH server install.
 
1. Check is it on or off:
a) open x-term
b) type "ps | grep sshd"
if you will get line with "/usr/sbin/sshd"
It is working.

2. type "rm -R /root/.ssh"
it will remove all settings for ssh

fatalsaint 2010-01-13 17:37

Re: Need help cleaning up OpenSSH server install.
 
My personal guess is it needs a dpkg-reconfigure .. but won't know without a log report or command output.

Laughingstok 2010-01-13 17:41

Re: Need help cleaning up OpenSSH server install.
 
Quote:

Originally Posted by Elhana (Post 468727)
Root password needed so you could login, not for it to work. For example I use rsa auth instead.


This line worries me, how exactly are you trying to connect? Because connecting to localhost from another machine is wrong.

Also it might be because sshd is not started after installing package, reboot device or run this
Code:

/etc/init.d/ssh start

ssh localhost

from the N900.

There are corrupted files on the N900 somewhere. I need to figure out what all I need to clean-up

Laughingstok 2010-01-13 17:42

Re: Need help cleaning up OpenSSH server install.
 
Quote:

Originally Posted by Spenc3 (Post 468744)
have you try cleaning the install??
i.e. sudo apt-get remove --purge openssh-server in xTerm?

Hopefully that will bring it back to a state where you can start off scratch again.

I will try this. Thanks.

Laughingstok 2010-01-13 17:44

Re: Need help cleaning up OpenSSH server install.
 
dpkg: error processing openssh-server (--purge):
subprocess post-removal script returned error exit status 1
Errors were encountered while processing:
openssh-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

fatalsaint 2010-01-13 17:46

Re: Need help cleaning up OpenSSH server install.
 
Code:

dpkg-reconfigure openssh-server

Laughingstok 2010-01-13 17:48

Re: Need help cleaning up OpenSSH server install.
 
dpkg -reconfigure does not work
dpkg-reconfigure is not found.

fatalsaint 2010-01-13 17:49

Re: Need help cleaning up OpenSSH server install.
 
It should all be one word.

Seriously? The N900 lacks dpkg-reconfigure? Fail. Check in /usr/sbin - someone else had a problem where /usr/sbin wasn't in their $PATH.

You're running all these commands as root, correct?

Laughingstok 2010-01-13 17:50

Re: Need help cleaning up OpenSSH server install.
 
Quote:

Originally Posted by fatalsaint (Post 468801)
It should all be one word.

Seriously? The N900 lacks dpkg-reconfigure? Fail. Check in /usr/sbin - someone else had a problem where /usr/sbin wasn't in their $PATH.

You're running all these commands as root, correct?

Yes.

I did a "find / -name "dpkg*" -print" and looked at all dpkg* stuff.

It is not there.

echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin

fatalsaint 2010-01-13 17:53

Re: Need help cleaning up OpenSSH server install.
 
Try this then...

Code:

dpkg --configure openssh-server

fatalsaint 2010-01-13 17:55

Re: Need help cleaning up OpenSSH server install.
 
Updated that... I misread the command I think.

Laughingstok 2010-01-13 17:57

Re: Need help cleaning up OpenSSH server install.
 
dpkg: error processing openssh-server (--configure):
package openssh-server is not ready for configuration
cannot configure (current status 'config-files')
Errors were encountered while processing:
openssh-server

Laughingstok 2010-01-13 17:58

Re: Need help cleaning up OpenSSH server install.
 
Please note, openssh-server is currently "uninstalled"

I am not able to reinstall it due to some leftover stuff lying around after the battery was knocked out mid-install.

fatalsaint 2010-01-13 18:05

Re: Need help cleaning up OpenSSH server install.
 
In the past when I've interrupted the postint scripts it causes a failure in dpkg's configuration. Usually rexconfiguring the packages re runs that. Try installing again via apt-get and then if it fails using the cofigure command.

Spenc3 2010-01-13 18:12

Re: Need help cleaning up OpenSSH server install.
 
um.. try
sudo apt-get install --reinstall openssh-server

I'm just throwing it out there :P

fatalsaint 2010-01-13 18:16

Re: Need help cleaning up OpenSSH server install.
 
Quote:

Originally Posted by Spenc3 (Post 468834)
um.. try
sudo apt-get install --reinstall openssh-server

I'm just throwing it out there :P

Without the sudo ;).

Laughingstok 2010-01-13 18:28

Re: Need help cleaning up OpenSSH server install.
 
Alright, performed a command line install using --reinstall.

It pulled the deb, asked me for a password, but then said:

chpasswd: can't lock password file.

Then it created some SSH keys.
Then said:

useradd: unable to lock password file

Afterwards, I tried to ssh localhost again and failed. Doesn't appear to be working still.

fatalsaint 2010-01-13 19:39

Re: Need help cleaning up OpenSSH server install.
 
ls -al /etc/ | grep passwd

Laughingstok 2010-01-13 19:54

Re: Need help cleaning up OpenSSH server install.
 
Quote:

Originally Posted by fatalsaint (Post 468979)
ls -al /etc/ | grep passwd

The passwd file exists. What do you want to know about it?

Laughingstok 2010-01-13 19:55

Re: Need help cleaning up OpenSSH server install.
 
-rw-r--r-- 1 root root 1003 Jan 13 10:27 /etc/passwd

fatalsaint 2010-01-13 20:22

Re: Need help cleaning up OpenSSH server install.
 
there should be a few .lock files in there... shadow.lock, passwd.lock, and group.lock.

They need to be removed...

Short of this... check your root filesize usage... it might be full.

Laughingstok 2010-01-13 21:53

Re: Need help cleaning up OpenSSH server install.
 
there is a "passwd. lock" (yes, with the space)

Not sure how to remove it

fatalsaint 2010-01-13 21:56

Re: Need help cleaning up OpenSSH server install.
 
It has a space?? Wow FUBAR'd.

Code:

rm /etc/passwd.\ lock
Also:
Code:

ls -al /etc/ | grep lock
If there are any of the others.. remove them too. After you remove it.. uninstall openssh-server and install it again.

Shaichico 2010-01-13 23:32

Re: Need help cleaning up OpenSSH server install.
 
Hi I have a similar problem however I have the following in /etc/

(passwd-) this is -rw-------
(passwd) this is -rw-r--r--

and I can't SSH into the N900 from my linux machine

the SSH daemon is up and able to bring the RSA fingerprint and not really sure where its going wrong.

Edit: Should I remove these and reinstall?

fatalsaint 2010-01-14 00:13

Re: Need help cleaning up OpenSSH server install.
 
Nono.. don't remove the passwd file ;). That's quite important.

The passwd- can be ignored as well.

Your problem does not appear to be the same... can you run:
Code:

ssh root@localhost
From your N900 and connect?

Shaichico 2010-01-14 00:26

Re: Need help cleaning up OpenSSH server install.
 
Quote:

Originally Posted by fatalsaint (Post 469444)
Nono.. don't remove the passwd file ;). That's quite important.

The passwd- can be ignored as well.

Your problem does not appear to be the same... can you run:
Code:

ssh root@localhost
From your N900 and connect?

Yes you are right. somehow I was playing around and then I tried root like you said before I read your post. I guess its a trial and error thing. Thanks for the help!

Edit: I was using putty via Win7 somehow it does not work directly connecting root@localhost. I managed to get it working with by using my NIX machine to the N900. It also works by using putty by ssh'ing to a NIX machine and then ssh'ing onto N900.
The issue is with the putty client itself!

Laughingstok 2010-01-14 00:38

Re: Need help cleaning up OpenSSH server install.
 
It was the lock file, problem solved

fatalsaint 2010-01-14 00:38

Re: Need help cleaning up OpenSSH server install.
 
Glad you got it sorted.


All times are GMT. The time now is 10:51.

vBulletin® Version 3.8.8