Unable to ssh as root after installing openssh

Questions about IPKG can go here!
Forum rules
Please note the disclaimer before modifying your Synology Product.

Unable to ssh as root after installing openssh

Postby windar » Thu May 29, 2008 12:48 am

Hello all,

I just ran an ipkg install openssh on my DS107+.
The problem is that now I cannot ssh in with user root, the password is no longer valid.
I can still log in as user admin and the web ui is still accessible but admin's privileges are too low to let me modify any system settings (disabling the sshd startup script would be an interesting idea :-) ).
I did not install sudo (my tough luck).
I ran the official Disable_SSH patch via the web ui, this didn't change anything, there's still an sshd running...

It seems that installing the openssh package "overrides" the original sshd, the main problem is it's now prompting me with a password that I do not know :-(

Does anyone out there have any clues ?

Thanks
Jungle Power !
User avatar
windar
Student
Student
 
Posts: 68
Joined: Wed May 28, 2008 12:35 pm

Re: Unable to ssh as root after installing openssh

Postby windar » Thu May 29, 2008 1:01 am

OK, telnet access to my DS107+ just about saved my life :-D
Managed to set a root password for ssh access (sshd from optware, official ssh access is disabled).

But there's definitely something a little odd about this...
Jungle Power !
User avatar
windar
Student
Student
 
Posts: 68
Joined: Wed May 28, 2008 12:35 pm

Re: Unable to ssh as root after installing openssh

Postby R-T » Sat May 31, 2008 2:16 am

Confirmed here on DS-207+ with latest stable FW #598.

When connecting to SSH I get a "key fingerprint changed" warning -so far so good-, but can't auth as root:

Code: Select all
DiskStation> uname -a
Linux DiskStation 2.6.15 #598 Sat Apr 12 22:16:49 CST 2008 armv5tejl GNU/Linux
DiskStation> id
uid=1024(admin) gid=100(users)
DiskStation> su -
Password:
su: incorrect password


login via telnet worked fine, so I did as you did and used passwd to change the root password.
R-T
Trainee
Trainee
 
Posts: 10
Joined: Sat May 31, 2008 12:59 am

Re: Unable to ssh as root after installing openssh

Postby fetto » Fri Oct 17, 2008 11:34 pm

Hi!

Similar problem. I can telnet as root and su to anyone but root (unless I already are root).

Code: Select all
DiskStation> uname -a
Linux DiskStation 2.6.15 #722 Fri Sep 19 20:23:15 CST 2008 armv5tejl unknown
DiskStation> id
uid=0(root) gid=0(root)
DiskStation> dir `which su`
lrwxrwxrwx    1 root     root           19 Oct 16 18:38 /opt/bin/su -> /opt/bin/adduser-su
DiskStation> dir /opt/bin/adduser-su
lrwxrwxrwx    1 root     root            7 Oct 16 18:38 /opt/bin/adduser-su -> adduser
DiskStation> dir /opt/bin/adduser
-rwsr-sr-x    1 root     root        80628 Jun 11 09:02 /opt/bin/adduser
DiskStation> dir /etc/passwd
-rw-r--r--    1 root     root          460 Oct 17 23:58 /etc/passwd
DiskStation> dir /etc/group
-rw-r--r--    1 root     root          102 Oct 18 00:05 /etc/group
DiskStation> dir /etc/shadow
-rw-r--r--    1 root     root          358 Oct 17 23:57 /etc/shadow
DiskStation> su - fetto
fetto@DiskStation:/home/fetto$ id
uid=1026(fetto) gid=100(users)
fetto@DiskStation:/home/fetto$ su -
Password:
su: incorrect password


I've tried adding another user and changing the password for root and so on, but no good!
Thanks in advance for your help!

/Patrik
fetto
I'm New!
I'm New!
 
Posts: 1
Joined: Sun Oct 12, 2008 8:38 am

Re: Unable to ssh as root after installing openssh

Postby newash » Mon Nov 24, 2008 3:01 pm

Hi!

I have just run into this problem and in my case on the Web Admin interface truning
Network Services >> Terminal >> Enable SSH service
off and then on restored the original sshd, so I could log in back again and remove openssh. 8)
newash
I'm New!
I'm New!
 
Posts: 1
Joined: Mon Nov 24, 2008 2:52 pm

Re: Unable to ssh as root after installing openssh

Postby torbenfox » Mon Aug 31, 2009 7:01 am

I just had the same problem with my DS207+ - could not login as root via ssh - only as admin.
It was fixed by disabling SSH in the WEB management system, reenabling SSH and then change the admin password from the web interface (logging in as root via SSH at this stage worked, but using passwd to change the password seemed not to work?). Anyway, I'm now able to ssh as root with the new password.
torbenfox
I'm New!
I'm New!
 
Posts: 1
Joined: Mon Aug 31, 2009 6:33 am

Re: Unable to ssh as root after installing openssh

Postby bzhou » Tue Sep 01, 2009 7:02 pm

Best way would be to setup pubkey authentication.
bzhou
Knowledgeable
Knowledgeable
 
Posts: 344
Joined: Sat Jan 12, 2008 1:57 am

Re: Unable to ssh as root after installing openssh

Postby bernardn » Mon Jan 04, 2010 8:55 pm

I had the same problem after installing openssh. For a reason, the ipkg installs forbids root login by default. To enable you have to change the setting PermitRootLogin to yes:
Code: Select all
PermitRootLogin yes

As only root can modify this file, you will have to login by telnet to do it. Telnet can be enabled in the management interface.
Bernard.
bernardn
I'm New!
I'm New!
 
Posts: 2
Joined: Mon Jan 04, 2010 8:44 pm

Re: Unable to ssh as root after installing openssh

Postby agustin » Fri Feb 05, 2010 5:12 am

Great! I found the answer to my problem too! And with updated sshd via ipkg I was able to use scp which my preferred method of copying files to remote server.
agustin
I'm New!
I'm New!
 
Posts: 5
Joined: Tue Feb 02, 2010 1:42 pm

Re: Unable to ssh as root after installing openssh

Postby FreeMinded » Thu Aug 05, 2010 10:37 pm

bernardn wrote:I had the same problem after installing openssh. For a reason, the ipkg installs forbids root login by default. To enable you have to change the setting PermitRootLogin to yes:
Code: Select all
PermitRootLogin yes

As only root can modify this file, you will have to login by telnet to do it. Telnet can be enabled in the management interface.
Bernard.


I tried that but either it doesn't work or I can't find the correct file to edit. Shouldn't it be in /opt/etc/openssh/sshd_config?
I uncommented PermitRootLogin yes and rebooted the box. But still no ssh access as root (admin works fine). I also tried with modifying /etc/ssh/sshd_cofig with teh same result. Anyway I asume that this would be the config for the original sshd. Any ideas what I have overlooked?

Thanks in advance
FM
--
DS-107+ and several machines running the most recent Kubuntu version
FreeMinded
Beginner
Beginner
 
Posts: 25
Joined: Tue Aug 28, 2007 12:04 am
Location: Zürich, Switzerland

Re: Unable to ssh as root after installing openssh

Postby FreeMinded » Thu Aug 05, 2010 10:51 pm

OK, some more search gave me the solution. The standard root password is "synopass" (without the quotes). In the built in sshd the root password is mapped to root. Login with synopass and change the password using the command "passwd". Then it works again as one would expect. This seems to be a nice backdoor once you permit root login.
--
DS-107+ and several machines running the most recent Kubuntu version
FreeMinded
Beginner
Beginner
 
Posts: 25
Joined: Tue Aug 28, 2007 12:04 am
Location: Zürich, Switzerland

Re: Unable to ssh as root after installing openssh

Postby RED » Sat Mar 10, 2012 2:04 am

FreeMinded wrote:The standard root password is "synopass" (without the quotes).

What the heck!? You are right! What kind of foolishness is this? I guess this is where I should cook my DS at 150 degrees Celsius for 10 minutes because it could be compromised.

Login with synopass and change the password using the command "passwd". Then it works again as one would expect. This seems to be a nice backdoor once you permit root login.

I'd love to change that and bring ssh back online, but there is no passwd command.
RED
I'm New!
I'm New!
 
Posts: 4
Joined: Wed Dec 02, 2009 9:26 am

Re: Unable to ssh as root after installing openssh

Postby slowhand73 » Sun Apr 15, 2012 1:41 pm

Hello all, this is my first post here !

RED wrote:I'd love to change that and bring ssh back online, but there is no passwd command.

You can use :
Code: Select all
mkpasswd -5

to generate a md5 password and the replace the root password with this new one in /etc/shadow !

(mkpasswd is brought by the whois ipkg package by the way).
User avatar
slowhand73
I'm New!
I'm New!
 
Posts: 1
Joined: Sun Apr 15, 2012 1:24 pm
Location: France

Re: Unable to ssh as root after installing openssh

Postby Goner » Sun Apr 15, 2012 2:02 pm

I thought the 'root' password was the same as the DSM 'admin' password ? :?
So if you change the admin password in DSM, you also have a new root password ...

RED wrote:I'd love to change that and bring ssh back online, but there is no passwd command.


synouser --help
Copyright (c) 2003-2012 Synology Inc. All rights reserved.

Usage: synouser (Version 2198)
--help
--rebuild {all|(domain Force{0|1})|(ldap Force{0|1})}
--enum {local|domain|ldap|all|domain_used}
--enumpre {local|domain|all|domain_used} prefix Caseless{0|1}
--enumsub {local|domain|all|domain_used} substr Caseless{0|1}
--get username
--getuid UID
--add [username pwd "full name" expired{0|1} mail privilege]
--modify username "full name" expired{0|1} mail
--rename old_username new_username
--setpw username newpasswd
--del username1 username2 ...
--login username pwd
--dbopen2 username

NAS : DS212j with 2 ST2000DL003 in SHR / DSM 4.2-3211
LAN : Fritz!Box 7170, 4 Devolo, 1 Icidu 200Mbps AV homeplugs, 2 5-port switches
HW : Conceptronic CHD3NET, ACRyan Playon!HD, Eminent EM7075dts, Wii U, PS2
User avatar
Goner
Enlightened
Enlightened
 
Posts: 460
Joined: Tue Mar 06, 2012 2:27 pm
Location: Rotterdam, Netherlands

Re: Unable to ssh as root after installing openssh

Postby RED » Sun Apr 15, 2012 3:56 pm

Goner wrote:I thought the 'root' password was the same as the DSM 'admin' password ? :?
So if you change the admin password in DSM, you also have a new root password ...


Nope, not for me. ssh root is always that same scary default. Maybe it's different with a clean firmware installation, but I got here after a bunch of upgrades throughout the years. Don't know if that makes different behavior due to some old links or configs or idk.

synouser --help
(..)
--setpw username newpasswd


Thanks, I'll try it out next time I have physical access to the DS. :)
RED
I'm New!
I'm New!
 
Posts: 4
Joined: Wed Dec 02, 2009 9:26 am

Next

Return to IPKG

Who is online

Users browsing this forum: No registered users and 1 guest