× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Re: SSH and SMB service not starting anymore

stebo85
Tutor

SSH and SMB service not starting anymore

Dear community,

 

After installing the add-on Log-Analyzer my RN10200 started to have some issues as I was not able to see the shares via Samba anymore. I tried logging in via SSH to see what's wrong but also SSH stopped working. Since the web-admin panel is still working I tried to activate SMB and SSH in the panel, but it briefly turns green and then grey again. I also tried uninstalling the add-on, but now get a package manager error. I then tried to reinstall the OS using the boot-option, but this did not help either.

 

I removed the harddrives from the device and mounted them read-only to see what's wrong. There I found some permissions to be set incorrectly on the system partition:

 /mnt/systemOld# ls -la
total 124
drwxr-xr-x 26 root root 4096 May 19 21:03 .
drwxr-xr-x 4 root root 4096 May 24 07:04 ..
drwxr-xr-x 2 root root 4096 May 5 2015 apps
drwxr-xr-x 2 root root 4096 May 19 19:51 bin
drwxr-xr-x 2 root root 4096 Jun 17 2012 boot
drwxrwxrwt 2 root root 4096 May 5 2015 data
drwxr-xr-x 4 root root 4096 May 19 19:51 dev
drwxr-xr-x 79 root root 4096 May 19 21:32 etc
drwxr-xr-x 6 guest guest 4096 May 19 19:51 frontview
drwxr-xr-x 2 root root 4096 Jun 17 2012 home
lrwxrwxrwx 1 guest guest 5 Jul 18 2015 homes -> /home
drwxr-xr-x 14 guest guest 4096 May 19 19:51 lib
drwxrwxrwx 2 guest guest 16384 May 5 2015 lost+found
drwxr-xr-x 2 root root 4096 Nov 18 2012 media
drwxr-xr-x 3 root root 4096 Jun 17 2012 mnt
drwxr-xr-x 9 root root 4096 Nov 26 10:59 opt
drwxr-xr-x 2 root root 4096 Jun 17 2012 proc
-rwxrwxrwx 1 guest guest 1024 May 5 2015 .rnd
drwx------ 5 root root 4096 May 19 19:51 root
drwxr-xr-x 3 guest guest 4096 May 19 17:52 rsyslog
drwxr-xr-x 2 root root 4096 Aug 18 2015 run
drwxr-xr-x 2 guest guest 4096 May 19 19:51 sbin
drwxr-xr-x 2 root root 4096 Jun 10 2012 selinux
drwxr-xr-x 2 guest guest 4096 Nov 18 2012 srv
drwxr-xr-x 2 root root 4096 Feb 8 2013 sys
drwxrwxrwt 7 guest guest 4096 May 19 21:32 tmp
-rwxrwxrwx 1 guest guest 33 May 19 17:48 .update_fail
drwxr-xr-x 10 root root 4096 Nov 26 10:59 usr
drwxr-xr-x 18 root root 4096 May 19 19:51 var

 

instead of:

ls -la /
total 120
drwxr-xr-x 26 root root 4096 May 23 07:40 .
drwxr-xr-x 26 root root 4096 May 23 07:40 ..
drwxrwxrwx 1 root root 116 May 23 20:45 apps
drwxr-xr-x 2 root root 4096 May 23 07:39 bin
drwxr-xr-x 2 root root 4096 Jun 17 2012 boot
drwxr-xr-x 1 root root 250 May 22 10:36 data
drwxr-xr-x 13 root root 3480 May 23 20:53 dev
drwxr-xr-x 79 root root 4096 May 23 20:46 etc
drwxr-xr-x 6 root root 4096 May 23 07:39 frontview
drwxr-xr-x 1 admin admin 0 May 19 22:17 home
drwxr-xr-x 14 root root 4096 May 23 07:39 lib
drwx------ 2 root root 16384 May 19 22:17 lost+found
drwxr-xr-x 2 root root 4096 May 19 22:49 md124
drwxr-xr-x 4 root root 80 May 23 20:53 media
drwxr-xr-x 4 root root 4096 May 24 07:04 mnt
drwxr-xr-x 9 root root 4096 May 13 16:48 opt
dr-xr-xr-x 188 root root 0 Jan 1 1970 proc
-rw------- 1 root root 1024 May 19 22:17 .rnd
drwx------ 3 root root 4096 May 23 07:39 root
drwxrwxr-x 26 root admin 820 May 23 20:53 run
drwxr-xr-x 2 root root 4096 May 23 07:39 sbin
drwxr-xr-x 2 root root 4096 Jun 10 2012 selinux
drwxr-xr-x 2 root root 4096 Nov 18 2012 srv
dr-xr-xr-x 11 root root 0 May 24 07:05 sys
drwxrwxrwt 7 root root 4096 May 24 07:17 tmp
-rw-r--r-- 1 root root 0 May 23 07:38 .update_success
drwxr-xr-x 10 root root 4096 May 13 16:48 usr
drwxr-xr-x 17 root root 4096 May 23 07:39 var

 

could this be cause of the problem? Any other ideas how I get the SSH and SMB service back working or get more diagnostic information?

 

I do have a backup of everything so a full factory reset would be an option. However, I would like to understand the problem and rather solve it using telnet as it seems to be quite a simple problem? Would it be enough to reset the permissions? What else could cause this behaviour?

 

Thanks for any hints

Best

Steffen

Model: RN10200|ReadyNAS 100 Series 2- Bay (Diskless)
Message 1 of 10

Accepted Solutions
kohdee
NETGEAR Expert

Re: SSH and SMB service not starting anymore

You would have to go folder by folder and read all the folders it is complaining about and chown the permissions back to root instead of guest. It's tedius but eventually you can get it all started again. 

View solution in original post

Message 8 of 10

All Replies
mdgm-ntgr
NETGEAR Employee Retired

Re: SSH and SMB service not starting anymore

How full is the OS partition? Another possibility could be filling that. It's 4GB so if you put stuff on there that shouldn't be there it can fill fast.

Message 2 of 10
stebo85
Tutor

Re: SSH and SMB service not starting anymore

Dear mdgm,

 

Thank you for the hint. Unfortunately the system disk is not full. 808MB used and 3.0GB available. 

 

Thank you

Steffen

 

Message 3 of 10
mdgm-ntgr
NETGEAR Employee Retired

Re: SSH and SMB service not starting anymore

Can you send me the logs (see the Sending Logs link in my sig)?

Message 4 of 10
stebo85
Tutor

Re: SSH and SMB service not starting anymore

Dear mdgm,

 

When I put back the original harddrives in the RN102 it updated the firmware to the most current one since I had this firmware installed on my testharddrive. This fixed the SMB service somehow.

 

However, SSH is still broken and the logs also suggest that it is caused by the wrong permissions:

May 27 21:54:28 Keksbox systemd[1]: Unit ssh.service entered failed state.
May 27 21:54:28 Keksbox systemd[1]: ssh.service holdoff time over, scheduling restart.
May 27 21:54:28 Keksbox sshd[4153]: /var/run/sshd must be owned by root and not group or world-writable.

 

What is the best way to fix this :?

I send you the full logs.

 

Thank you for the help!

Message 5 of 10
mdgm-ntgr
NETGEAR Employee Retired

Re: SSH and SMB service not starting anymore

That's odd. As that file is stored in RAM. Odd that it would get the wrong ownership/permissions.

Which apps have you installed on this system?

Have you installed other packages?

I didn't receive the logs, can you try sending them again?

Message 6 of 10
mdgm-ntgr
NETGEAR Employee Retired

Re: SSH and SMB service not starting anymore

Looks like something is trying to change the ownership of everything on the system. Not sure what.

 

You last factory reset on 6.1.4. Might not be a bad idea to backup your data, do a factory default (wipes all data, settings, everything) and restore your data from backup.

Message 7 of 10
kohdee
NETGEAR Expert

Re: SSH and SMB service not starting anymore

You would have to go folder by folder and read all the folders it is complaining about and chown the permissions back to root instead of guest. It's tedius but eventually you can get it all started again. 

Message 8 of 10
stebo85
Tutor

Re: SSH and SMB service not starting anymore

Thank you,

 

I could log in via telnet and change back the ownership to root and chmod the /etc/ssh/ssh_host* files to 600.

 

This fixed it 🙂 Much quicker than factory reset. 

 

Thank you for the help

Cheers

Steffen

Message 9 of 10
stebo85
Tutor

Re: SSH and SMB service not starting anymore

Just for completeness and in case someone else has the same problem:

 

Resetting the permissions was easy thanks to this great script: https://gist.github.com/paalfe/c4c87be63c7519d1dbe8

 

After rebooting the readynas from the telnet service mode you have to be quick to login via SSH, because unfortunately the permissions are getting reset to guest after a few minutes. The reason is that loganalyzerr6 is still trying to install itself and during that install it changes all permissions. I tried to purge it using apt-get -y purge loganalyzerr6, but this did not work because dpkg was already running in the background and was stuck in the install loganalyzerr6. However, it worked to kill dpgk and then run dpkg --purge loganalyzerr6. Then I reset the permissions again and now it works.

 

Best

Steffen

Message 10 of 10
Top Contributors
Discussion stats
  • 9 replies
  • 3953 views
  • 3 kudos
  • 3 in conversation
Announcements