# Permisson problem



## dramcio (Nov 3, 2012)

Hello. I have got permisson problem.

When I was start system in normal mode I have got many errors etc:

```
/etc/login.conf is world writable

/etc/mail/submit.cf WARNING dangerous writable permissons
```

When I was start system in single mode, there are no errors.

Lately I want to install perl and script (dbi, mysql).

Please help me


----------



## dramcio (Nov 3, 2012)

I have fix some errors. Now i can log using ssh but

Mysql won't start : 

```
Starting mysql.
su: /bin/csh: Permission denied
./mysql-server: WARNING: failed to start mysql
```

can not chdir /var/spool/clientmqueue


proftpd starts but I can't log into my users


```
192.168.1.100 UNKNOWN nobody [03/Nov/2012:09:56:36 +0100] "USER root" 331 -
192.168.1.100 UNKNOWN nobody [03/Nov/2012:09:56:36 +0100] "PASS (hidden)" 530 -
192.168.1.100 UNKNOWN nobody [03/Nov/2012:09:56:38 +0100] "QUIT" 221 -
```
This is fault of "chown" - I think that, when I change user in proftpd.conf to root, I can log into user "root" (using ftp) but I can't log in to ftp by other users.


Help me


----------



## AlexJ (Nov 3, 2012)

You probably did something very incorrect things with your system, something like 
[cmd=""]# cd / && chmod 777 -R / # <= DON'T DO THIS (!!!)[/cmd]

The best way IMHO, - is reinstall your setup, but you can try to fix it by resetting permissions to default ones:


```
# cd /
# mtree -U -f /etc/mtree/BSD.root.dist
# mtree -U -f /etc/mtree/BSD.var.dist
# mtree -U -f /etc/mtree/BSD.usr.dist
```


----------



## niellusNL (Nov 7, 2012)

Starting the system in single user mode automatically logs you in as root. It's the first point in the boot process where FreeBSD can present you with a shell. You can use it to fix things. 

While being root you are boss, meaning you can do everything without extra permissions and there is nothing to stop you! So i'd say it's pretty normal you don't get the error messages in single user mode.


----------



## usdmatt (Nov 7, 2012)

The errors come up on a normal boot and not single user mode because it's various system services that are checking their configuration files and finding permissions problems. None of these services will be starting in single user mode so the errors won't appear. It's not really got anything to do with the fact that in single user mode you are root and have more permissions - those errors will most likely be coming up before login and starting as root anyway.

The main issue as mentioned by AlexJ is that for some reason all the permissions on the system appear to be screwed. It's possible to fix a lot of it with mtree but this won't fix permissions that may be messed up on files added by the user or third party software so it's easier to just reinstall if possible (which is why AlexJ also considered this the best option).

Whatever was run to screw up all the permissions - try not to do that again...


----------

