What does it do? Saying "it doesn't work" doesn't give any idea of what's going wrong, you know. The second command you list looks correct in form, assuming you have the correct path to occ.su -u www php /usr/local/www/nextcloud/occ user:resetpassword admin doesn't work
What does it do?
su -u www php /usr/local/www/nextcloud/occ user:resetpassword admin su: illegal option -- u usage: su [-] [-flms] [-c class] [login [args]]
root@nextcloudS:/usr/local/www/nextcloud # ls -l total 197 -rw-r--r-- 1 www www 2824 Apr 8 18:47 .htaccess -rw-r--r-- 1 www www 163 Mar 13 14:47 .user.ini drwxr-xr-x 33 www www 41 Mar 13 14:55 3rdparty -rw-r--r-- 1 www www 12063 Mar 13 14:47 AUTHORS drwxr-xr-x 36 www www 36 Mar 13 14:48 apps drwxr-xr-x 2 www www 5 Apr 8 18:46 config -rw-r--r-- 1 www www 3593 Mar 13 14:47 console.php drwxr-xr-x 17 www www 23 Mar 13 14:55 core -rw-r--r-- 1 www www 4946 Mar 13 14:47 cron.php drwxr-xr-x 2 www www 5 Apr 8 18:47 data -rw-r--r-- 1 www www 179 Mar 13 14:47 index.html -rw-r--r-- 1 www www 3417 Mar 13 14:47 index.php drwxr-xr-x 6 www www 9 Mar 13 14:47 lib -rw-r--r-- 1 www www 283 Mar 13 14:47 occ drwxr-xr-x 2 www www 5 Mar 13 14:47 ocs drwxr-xr-x 2 www www 3 Mar 13 14:47 ocs-provider -rw-r--r-- 1 www www 3214 Mar 13 14:47 public.php -rw-r--r-- 1 www www 5370 Mar 13 14:47 remote.php drwxr-xr-x 4 www www 4 Mar 13 14:47 resources -rw-r--r-- 1 www www 26 Mar 13 14:47 robots.txt drwxr-xr-x 14 www www 19 Mar 13 14:47 settings -rw-r--r-- 1 www www 2274 Mar 13 14:47 status.php drwxr-xr-x 3 www www 4 Mar 13 14:47 themes drwxr-xr-x 2 www www 4 Mar 13 14:48 updater -rw-r--r-- 1 www www 362 Mar 13 14:54 version.php
...and what does the second command do? The first one you posted would be the correct form for sudo, but not for su. But su -m should be correct.su: illegal option -- u
...and what does the second command do? The first one you posted would be the correct form for sudo, but not for su. But su -m should be correct.
su -m www php /usr/local /www/nextcloud/occ user:resetpassword admin php: No such file or directory.
Ok so I ran locate php and found it is in the /var/run directory so I ran the 2nd command I posted after entering the /var/run directory and it asked me for a new password. Success.So the php binary isn't in the system path. Looks like you need to find it.
su -m www -c 'php /usr/local/www/owncloud/occ config:system:set memcache.local --value="\OC\Memcache\APCu"'
su -m www -c 'php /usr/local/www/owncloud/occ config:system:set memcache.locking --value="\OC\Memcache\Redis"'
su -m www -c 'php /usr/local/www/owncloud/occ config:system:set redis host --value="/tmp/redis.sock"'
su -m www -c 'php /usr/local/www/owncloud/occ config:system:set redis port --value=0 --type=integer'
? If you used the php packages, it should be in /usr/local/bin/php (which should be in your path):I ran locate php and found it is in the /var/run directory
[root@nextcloud ~]# which php /usr/local/bin/php
That file is in your FreeNAS system, not in the jail. Once the script has run, there shouldn't be anything that automatically removes it.The passwords were generated by your script and saved to /root/db_password.txt but the file doesn't exist any more.
Inside the jail, it's in /root/.my.cnf.I can get the mysql db password from the nextcloud/config/config.php is there a way to get the root password?
? If you used the php packages, it should be in /usr/local/bin/php (which should be in your path):
root@nextcloudS:~ # echo $PATH /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin root@nextcloudS:~ # which php /usr/local/bin/php
Every once in a while I forget that I'm in a jail or in the FreeNAS system by mistake. Sorry.That file is in your FreeNAS system, not in the jail.
[server] skip-networking skip-name-resolve expire_logs_days = 1 innodb_flush_method = O_DIRECT skip-innodb_doublewrite innodb_flush_log_at_trx_commit = 2 innodb_file_per_table
That's odd. Here's mine (and yes, I realize I'm sharing the password here; I just destroyed that jail, so there's no exposure):My /root/.my.cnf file has this in it.
# MySQL client config file [client] password=fvT++SOpE8x9L7LIf/oqbQ==
[client] # MySQL client config file password=mypassword
mysql
?Ah, that explains it. I'd still suggest adding the password line to /root/.my.cnf; should you need to do anything with the database from inside the jail, it will make it a lot easier.and he has you edit the /usr/local/etc/my.cnf with the contents I listed above.
ssh <username>@<freenas_ip_address> sudo su - su -m www -c 'php /usr/local/www/nextcloud/occ user:resetpassword <PUT YOUR ADMIN USER NAME IN HERE>' The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php Enter a new password: Confirm the new password: Successfully reset password for nc_admin
su -m www -c 'php /usr/local/www/nextcloud/occ user:resetpassword root' The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php The current PHP memory limit is below the recommended value of 512MB. Nextcloud is not installed - only a limited number of commands are available There are no commands defined in the "user" namespace.