asked on
ownership moving error?
i try to move ownership from one to other user:
both users has logged in to web access
i do the following from command line
sudo -u www-data php occ files:transfer-ownership "source-user" "destination-user
Error:
The target user is not ready to accept files. The user has at least to be logged in once.
What is wrong here?
ASKER
Users is a locally nextcloud users.
i can see my users under (on linux dir /nextcloud) then as root wrote
sudo -u www-data php occ files:transfer-ownership "source-user" "destination-user
Did you create the user, where the user has never logged on? in that case all data structures for that user are missing.
(A user entry as such only creates the right to access...)
All the data, directory etc. etc. is done during first logon.
After first logon you can do what you want.
@david: for nextcloud ssh access is normaly NOT available.
For a Host admin it probably is. You can subscribe to Nextcloud SP's where you definitely have NO ssh access.
You should try it once... it has some very useful stuff... and is compliant to GDPR, probably also CA, US law on customer protection..
ASKER
But When i look at auth.log the error say pam_unix session is opend for users www-data and 2 Second after closed(pam_unix)
The server is joind Active Directory (samba) but I do not have a users www-data in My users.
Maybe i need to have some.
First this has nothing to do with logged on or not....
If you create a user test (only nextcloud) and store some stuff there....
then your create a user test2 and call sudo -u www-data php occ files:transfer-owner test test2 then all files from user test are transfered to a folder named 'transferred from test on 2020-02-02 16-03-10' inside the "test2" account. The test account has no more files/folders.
Also all shared stuff that used to be from test will be from test2 to others...
This is probably not what you are looking for.
(ownership IN nextcloud is only the place in the folder structure below a user).
The location of the data directory is described in the config.php file. ( lets assume this is /data )
The user specific data is below this so /data/test contains everything that belongs to user test.
The files for user test are below: /data/test/files ( cached info is in /data/test/cache )
What is presented on the browser window is from the database. When you create / remove/ share a file only some registration in the database is done.
besides doing some stuff on the disk.
When you create files "behind" nextcloud in that directory nothing will be shown until you do a files:rescan for that user.
Nextcloud ownership has no relationship whatsoever to linux/windows ownership.
The only requirement is that the webservice (apache + mod_php) or php-fpm can maniputae the files., which means www-data must be the (unix/windows) owner of the files.
Nextcloud CAN work without unix integration as far as unix integration is used than only as authentication source nothing else. No home directory (the webserver / php-fpm service) would not be able to touch/read/write... files in those directories. Al kinds of services can be used as authentication source (effectively only a password checking source), Among those services: Unix pam, LDAP, SharePoint, OAuth2, etc. etc.
ASKER
but what is wrong here why i can't move ownership.
the example you describe, it's exactly what i want. i have a user and i want to move every things under this user to other share directory and .... .
but not to delete user1. all users has until now it should move to other then after that user 1 exist as normal user.
If the target user has been logged on once the directories and other scaffolding in the database & storage have been created.
I'll check the code later, if there are more requirements that advertised.
ASKER
users has logged in, and storage is created. but not possible to move ownership.
(sorry for all the colours, i am using the beta functions on the site seems it needs a bit of work still, i cannot get rid of them).
ASKER
Like always you was right.
ASKER
Like always you was right.
Likely what's meant is an ssh login, rather than whatever "web access" might mean.
In other words, the actual "destination-user" system accounting must be... incremented... to show user is real...
Try an ssh login, then run your operation again.