[Errno 13] Permission denied as root, can't access SSH

Status
Not open for further replies.

kraab

Dabbler
Joined
Jan 31, 2015
Messages
14
Hey Guys,

Made a terrible mistake earlier, while I was adjusting permissions on owncloud jail I was frustrated and made the permissions to be nogroup and nobody, also made it so there was a black box in each of the permissions below as to not change the octet of permission.
After doing this I was unable to access owncloud, I changed the permissions back on the jail to be root and wheel but now I cannot access most administrative functions including SFTP. Most pages in the admin ui are error pages now, images below.

Is there anything I can do to reset my permissions to a known state? I cannot login with Winscp now as root, it seems to think my password has changed, gives the error access denied and asks again. I also tried to add new user, but this fails with error "[Errno 13] Permission denied"

Any and all help is appreciated, thank you!
 

Attachments

  • 1.PNG
    1.PNG
    155.7 KB · Views: 518
  • 2.PNG
    2.PNG
    68.7 KB · Views: 472
  • 3.PNG
    3.PNG
    143.1 KB · Views: 654
  • 4.PNG
    4.PNG
    135.9 KB · Views: 458
  • 5.PNG
    5.PNG
    137.3 KB · Views: 482
  • 6.PNG
    6.PNG
    24.1 KB · Views: 500

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
SSH (as root, or switch to root just after you SSH'd) to FreeNAS (not the jail) and use jexec to go inside the jail (as root) to clean the mess :)
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
SSH (as root, or switch to root just after you SSH'd) to FreeNAS (not the jail) and use jexec to go inside the jail (as root) to clean the mess :)
If the jexec command is too confusing you can also type 'warden chroot <jailname>' for example 'warden chroot owncloud'.

I personally prefer this method (jexec / warden) to enabling ssh inside a jail.
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
I don't think jexec <jailname> /bin/csh is that much more complicated... :)
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
+1 because I laughed :)
 

kraab

Dabbler
Joined
Jan 31, 2015
Messages
14
Hey Guys thank you so much for the help! I may not have been clear enough in my haste to post the information I have.

If you take a look at the screens above I cannot login to SSH as root or anybody, Freenas thinks my password has changed but I can still login to my web UI with it(this proves it hasn't). Once in the Freenas web ui, it is extremely broken, screens on first post, most pages do not work and yield error messages. I tried to add a user to Freenas and I cannot, get permissions error. Cannot edit password for root as I get a permissions error on applying the setting. Cannot restore to a snapshot, different error, image above. Cannot adjust system settings, permissions error.

Seems I have hosed my setup completely, I cannot get to any administrative settings. On the bright side my CIFS share is still working(tried to adjust permissions on it, got a permissions error, image above). I can provide access to the box if anyone wants to play with fire.

Thank you again!
 

rsquared

Explorer
Joined
Nov 17, 2015
Messages
81
How/where did you make the permission changes earlier? Both the original to nobody and the second change back to root.
 

kraab

Dabbler
Joined
Jan 31, 2015
Messages
14
How/where did you make the permission changes earlier? Both the original to nobody and the second change back to root.
I tried to adjust here permissions here /ssd/jails/owncloud_1/, I noticed the permissions did not apply then tried the file share for owncloud as well /zfs/windows/files/owncloud

Owncloud jail (/ssd/jails/owncloud_1/) runs from my SSD but the share is on separate zfs array here (/zfs/windows/files/owncloud |this mounts to| /ssd/jails/owncloud_1/mnt )
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
If you take a look at the screens above I cannot login to SSH as root or anybody, Freenas thinks my password has changed but I can still login to my web UI with it(this proves it hasn't). Once in the Freenas web ui, it is extremely broken, screens on first post, most pages do not work and yield error messages. I tried to add a user to Freenas and I cannot, get permissions error. Cannot edit password for root as I get a permissions error on applying the setting. Cannot restore to a snapshot, different error, image above. Cannot adjust system settings, permissions error.

So you've messed with the system then? not just the jail?

Have you a backup of the config file?
 

kraab

Dabbler
Joined
Jan 31, 2015
Messages
14
So while the above posts were great they were not able to guide me to repair, here is what I have done so far to get back into semi-working state.

Reboot server, permissions error won't boot past <sony storage>usb0, permissions denied error
Reboot server, chose last update from 1-20, freenas booted all the way to options menu but no internet, and weird ichwdg10 msg every minute or so, reset management, no luck
Reboot server, chose previous update 12-30, freenas booted all the way, no ichwdg message this time, says its available on IP 192.168.1.100
Connected to freenas on IP, can now see system page and all other pages. Need to repair permissions now, jails look to be started but getting no response on any IP.
Under storage menu -> jails -> owncloud, click permissions on dataset, already set for root:wheel and 755, checked the box for recursive
Restarted the jail, owncloud is now accessible
Under storage menu -> jails -> transmission, click permissions on dataset, already set for root:wheel and 755, checked the box for recursive
Restarted the jail, transmission is now accessible, shares will need permissions fix, error in transmission regarding datastore

Most other issues besides the permission have been resolved. CIFS is back, nothing needed to be done, Windows can access mapped drives like before. SSH is back working and my password is working as expected.

I tried the same thing with couchpotato & btsync but was not able to get working. Should I proceed to define a media permission in Freenas users at this point and then go to each jail and add user change permissions to run under media?
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Ok, backup the config, reinstall the system, import your config. Then you'll have a good base to work with ;)
 

kraab

Dabbler
Joined
Jan 31, 2015
Messages
14
Any suggestions for repairing my jails and there permissions? Looks like i'll be loosing a bunch of man hours into this anyway I cut it, just looking for the most efficient method.

Here is what I have left to repair after fixing Owncloud and Transmission...
  • Sickbeard
  • Couchpotato
  • SABnzbd
  • HTPC Manager
  • Subsonic
  • Headphones
  • phpVirtualbox
  • Cam Server
  • OpenVPN
  • Plex
  • btSync
 
Status
Not open for further replies.
Top