LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-08-2018, 09:45 AM   #1
Crb999
Member
 
Registered: Jan 2017
Location: West Coast Scotland
Distribution: Suse Linux 42.2 Now 15.1
Posts: 319

Rep: Reputation: Disabled
Shared folders and files not behaving!


====================================
=== openSUSE Leap
=== VERSION="42.3"
=== Malachite
=== kernel version is 4.13.0-rc4-1.g94b098f-default
=== Dell OptiPlex 780
=== X86-64
=== Intel Graphics Media Accelerator 950
=== Intel 4 Series Chipset Integrated Graphics Controller
=== Intel Gigabit Ethernet Controller
=== Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz
=== 8Gb RAM
=== Intel SATA Controller [RAID mode]
=== 2 x 1Gb HD (Mirrored)
=== PIONEER DVD-RW DVR-219L
=== WLAN network interface
====================================
Hi Folks,

A little while ago, I sought to find a quick and easy way to change users while remaining in a KDE environment.

It was suggested to me that a better way would be to set up a shared folder, then, so they said, anyone could access it as they would be common files. (Providing you had permission of course.)

I set about that with gusto.

I should point out that this is sharing between users on the same machine. Windows or Samba do not come into this.

In home/ I have a directory /shared
and in that directory I have the
directory /Memberdata, and
I have the file "members.ods"

The User and the group for all above is skw and karate resp.

Root, skw and members of karate can access, change and save the file(s).

Those changes are seen by the next user that opens the file.

'Libreoffice Sharing' within the file is not set and as the file may not be accessed by two users, it is not needed.

The ods file has entries which point at text files. By pressing Ctrl and selecting the link, (usually the practitioners name.) the file is opened for editing.

As user skw, I can navigate to /home/shared and drag the ods file to my desktop, selecting 'link here' when asked.

Once opened, I can hover over a name link and I get the location on the screen momentarily.

Using the Ctrl + name selection, the file pointed at, opens for editing.

That path was created while accessing the file as user skw,
and is as follows: /home/shared/Memberdata/A.ods

When I log in as a user in the group 'karate' and access the main file, all is well and is edited and/or saved as is expected however, when I hover over a name link to get the location on the screen momentarily, it is slightly different to what I had seen
as user skw!

eg.
as user skw, the path for applicant A is shown as:
link:file:///home/shared/Memberdata/A.ods

As a different user but in a permitted group, 'karate', the path for applicant A is shown as:
link:file:///../shared/Memberdata/A.ods
and results in a failure message, ie. /../shared/Memberdata/A.ods does not exist.

If now as a user in group 'karate', (but not skw), I set the pointer for applicant B, I am able to access the file ///home/shared/Memberdata/B.ods.

Saving and closing the file and then changing back to user skw, I find I can access ///home/shared/Memberdata/B.ods but can no longer
access applicant A, which now reports:/../shared/Memberdata/A.ods does not exist.

It takes hours and hours to go from user to user to access and/or edit the file and reset the pointers.

It's doing my head damage!

If anybody has any ideas, (apart from WHY?) how to get round this I would really appreciate it.

Regards

Chris
 
Old 02-08-2018, 10:05 AM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
looks like it is adding / that every time someone access it. let me review for my own understanding.

Staying in the KDE login and just using KDE's switch users option, you share a common directory under the parent directory /home

in order to give the everyone you want to access the files within that share did you use the group name to gain the common ground for all that belong to that group have access to whatever is in the shared folder, or by some other means?

did you leave the file in an open state by one of the users, then open it with the other user when testing this between two users?

Quote:
'Libreoffice Sharing' within the file is not set and as the file may not be accessed by two users, it is not needed.
may not necessary mean you should not at lest try using that option to see if that elevates your issue.

edit:::

you did what?
Quote:
As user skw, I can navigate to /home/shared and drag the ods file to my desktop, selecting 'link here' when asked.
dynamic linking is needed to update files between two sources that change same said file?.

try NOT using the link to get to the file but instead going to its source and opening and editing then saving, then if you want to quick open it use the recently opened option in the open->recently opened ( may not be spelled out or same words used) Menu option and see if that helps you out.


(maybe Windows refugee syndrome going on here)

Last edited by BW-userx; 02-08-2018 at 10:29 AM.
 
Old 02-08-2018, 10:23 AM   #3
Crb999
Member
 
Registered: Jan 2017
Location: West Coast Scotland
Distribution: Suse Linux 42.2 Now 15.1
Posts: 319

Original Poster
Rep: Reputation: Disabled
Hi BW-userx,

Thanks for your response.

Para 1: I agree though I hadn't noticed it til now.

Para 2: Correct

Para 3: I used the group name! 'skw' is the owner, 'karate' is a permitted group. I, in my own login, am a member of 'karate'

Para 4: I have been fastidious at closing the file before changing user. Further, I have regularly deleted the link for the ods file in both the user areas in question, and created a new link from the shared directory before continuing with the tests.

Para 5: I did try the Libre office sharing and it allowed access for first user but opened in a 'Read only' mode if opened elsewhere. I turned it off again.

Love your quotes :-)
 
Old 02-08-2018, 11:24 AM   #4
Crb999
Member
 
Registered: Jan 2017
Location: West Coast Scotland
Distribution: Suse Linux 42.2 Now 15.1
Posts: 319

Original Poster
Rep: Reputation: Disabled
So eager was I to get to the meat of your post that I missed it all together! Well I was using an android tablet.

Quote:
you did what?
Well I've done what you suggested, Opened the file at source and then used the 'Open recent file' to access it again.

That works well.

Thank you.

Regards

Chris
 
Old 02-08-2018, 11:53 AM   #5
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Let me see if I can explain this, how I did it in the same order it needs to be done, as I hack away on it until I figured it out.

I created two new users, created a new group put them both on it. made KDE their desktop, using startx on this Slack.
Code:
sharedfolders:x:1000:billybob,sallyjane
created a share folder as root, /home/share, made the owner one of the users, and the group ownership to the group I created.
Code:
bash-4.4# chown billybob /home/share

bash-4.4# chgrp sharedfolders /home/share

# this too is valid if you want to do it all in one command
bash-4.4# chown billybob:sharedfolders  /home/share


drwxrwsr-x 1 billybob  sharedfolders   48 Feb  8 11:46 .
gave the group read write execute
Code:
sudo chmod g+rwx /home/share
issued this command,
IMPORTANT: you need to try -aG instead as what I thought would happen doing it that way, did.
I lost all other groups they were attached to whereas -aG appends that group to all of the other groups already attached to.

as these are made up users it is not a big deal on my system.

Code:
sudo usermod -G sharedfolders sallyjane
sudo usermod -G sharedfolders billybob
inside of the folder
Code:
drwxrwsr-x 1 billybob  sharedfolders   48 Feb  8 11:46 .
drwxr-xr-x 1 root      root            64 Feb  8 10:27 ..
-rwxrwxr-x 1 billybob  users         8265 Feb  8 11:46 billybobob.odt
-rwxrwxr-x 1 sallyjane users         8054 Feb  8 11:42 shared.odt
both have read write to the files via the group.

now I have share files between both, opened libreoffice, edited the file with both users and libreoffice opened the same file with write permissions. .. in shorted it worked.

keep in mind this is not using links.


testing that IMPORTANT theory, let me go check if new user can do what they other two now can.
he kept all of the other groups he was already attached to.
Code:
bash-4.4# adduser jimmyjoe

Login name for new user: jimmyjoe

User ID ('UID') [ defaults to next available ]: 

Initial group [ users ]: 
Additional UNIX groups:

Users can belong to additional UNIX groups on the system.
For local users using graphical desktop login managers such
as XDM/KDM, users may need to be members of additional groups
to access the full functionality of removable media devices.

* Security implications *
Please be aware that by adding users to additional groups may
potentially give access to the removable media of other users.

If you are creating a new user for remote shell access only,
users do not need to belong to any additional groups as standard,
so you may press ENTER at the next prompt.

Press ENTER to continue without adding any additional groups
Or press the UP arrow key to add/select/edit additional groups
:  audio cdrom floppy plugdev video power netdev lp scanner wheel

Home directory [ /home/jimmyjoe ] 

Shell [ /bin/bash ] 

Expiry date (YYYY-MM-DD) []: 

New account will be created as follows:

---------------------------------------
Login name.......:  jimmyjoe
UID..............:  [ Next available ]
Initial group....:  users
Additional groups:  audio,cdrom,floppy,plugdev,video,power,netdev,lp,scanner,wheel
Home directory...:  /home/jimmyjoe
Shell............:  /bin/bash
Expiry date......:  [ Never ]

This is it... if you want to bail out, hit Control-C.  Otherwise, press
ENTER to go ahead and make the account.


Creating new account...


Changing the user information for jimmyjoe
Enter the new value, or press ENTER for the default
        Full Name []: jimmyjoe
        Room Number []: 
        Work Phone []: 
        Home Phone []: 
        Other []: 
Changing password for jimmyjoe
Enter the new password (minimum of 5 characters)
Please use a combination of upper and lower case letters and numbers.
New password: 
Re-enter new password: 
passwd: password changed.


Account setup complete.
bash-4.4# usermod -aG sharedfolders jimmyjoe
bash-4.4# cat /etc/group
root:x:0:root
bin:x:1:root,bin
daemon:x:2:root,bin,daemon
sys:x:3:root,bin,adm
adm:x:4:root,adm,daemon
tty:x:5:
disk:x:6:root,adm
lp:x:7:lp,userx64,jimmyjoe
mem:x:8:
kmem:x:9:
wheel:x:10:root,userx64,jimmyjoe
floppy:x:11:userx64,jimmyjoe
mail:x:12:mail
news:x:13:news
uucp:x:14:uucp
man:x:15:
dialout:x:16:uucp
audio:x:17:root,pulse,userx64,jimmyjoe
video:x:18:userx64,jimmyjoe
cdrom:x:19:userx64,jimmyjoe
games:x:20:
slocate:x:21:
utmp:x:22:
smmsp:x:25:smmsp
tape:x:26:
mysql:x:27:
rpc:x:32:
sshd:x:33:sshd
gdm:x:42:
shadow:x:43:
ftp:x:50:
oprofile:x:51:
sddm:x:64:
pulse:x:65:
input:x:71:
apache:x:80:
messagebus:x:81:
haldaemon:x:82:
plugdev:x:83:userx64,jimmyjoe
power:x:84:userx64,jimmyjoe
netdev:x:86:userx64,jimmyjoe
polkitd:x:87:
pop:x:90:pop
scanner:x:93:userx64,jimmyjoe
nobody:x:98:nobody
nogroup:x:99:
users:x:100:
console:x:101:
dovecot:x:94:
dovenull:x:95:
postfix:x:91:
postdrop:x:92:
cgred:x:41:
ntp:x:44:
sharedfolders:x:1000:billybob,sallyjane,jimmyjoe

Verdict:

It worked for the newly added user as well. so yes... whence you get that done, then you can try your links to your desktop afterwords.

Last edited by BW-userx; 02-08-2018 at 12:22 PM.
 
Old 02-10-2018, 04:02 AM   #6
Crb999
Member
 
Registered: Jan 2017
Location: West Coast Scotland
Distribution: Suse Linux 42.2 Now 15.1
Posts: 319

Original Poster
Rep: Reputation: Disabled
Thank you BW-userx

That's a lot of work and I thank you explaining it.

Would you be so kind as to try the next phase, which is to add a field in the calculation sheet that is a local url. That url being in the shared directory as well.

I don't know how familiar you are with this procedure so I'll describe it here but you can comfortably ignore it :-) Just skip to the ================

Create an odt file in the shared directory say xyz.odt

in a blank field in your sheet use Ctrl K to create a hyperlink.

In the dialogue that opens, on the left side pane, select 'Document'

In the new dialogue, fill in the path. You can ignore all the other settings but it is wise to add an identifier to the 'Text' field, say, xyz.

Apply and close.

Your blank field should now show 'xyz'

If you hover the mouse over the field, an instruction appears so

Ctrl click the xyz entry and the xyz file should open.

Add to it, perhaps the identity of the current login.

Save and leave, log out, log in as another.

So the question is, does it all behave as hoped for?
================
Right, as you've skipped down to here, thanks again for your investigations on my behalf :-)

Regards

Chris
 
Old 02-10-2018, 08:55 AM   #7
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Crb999 View Post
Thank you BW-userx

That's a lot of work and I thank you explaining it.

Would you be so kind as to try the next phase, which is to add a field in the calculation sheet that is a local url. That url being in the shared directory as well.

I don't know how familiar you are with this procedure so I'll describe it here but you can comfortably ignore it :-) Just skip to the ================

Create an odt file in the shared directory say xyz.odt

in a blank field in your sheet use Ctrl K to create a hyperlink.

In the dialogue that opens, on the left side pane, select 'Document'

In the new dialogue, fill in the path. You can ignore all the other settings but it is wise to add an identifier to the 'Text' field, say, xyz.

Apply and close.

Your blank field should now show 'xyz'

If you hover the mouse over the field, an instruction appears so

Ctrl click the xyz entry and the xyz file should open.

Add to it, perhaps the identity of the current login.

Save and leave, log out, log in as another.

So the question is, does it all behave as hoped for?
================
Right, as you've skipped down to here, thanks again for your investigations on my behalf :-)

Regards

Chris
How are you going to learn anything if I do all of your work for you? I have no need of that knowledge, whereas it looks that you do... think about it...
 
Old 02-10-2018, 09:16 AM   #8
Crb999
Member
 
Registered: Jan 2017
Location: West Coast Scotland
Distribution: Suse Linux 42.2 Now 15.1
Posts: 319

Original Poster
Rep: Reputation: Disabled
That came as a surprise!

I don't really want you to do anything for me. I was surprised at what you did.

But, you knew there would be a but, none of your work demonstrates a solution to my problem.

That part, the part I descibed, is what the whole exercise is about.

This is the only part where the shared folder principle falls down!

I have a shared folder various users are enabled to read and write to it, no problems, but
A certain function fails. Nobody knows why!

You've come up with proof of the shared folders principle but I have already got that.

If you had told me that the urls were maintained correctly then I would explore your solution, but you haven't.

I suspect they won't be maintained.

We'll never know! Shame.

Thanks anyway.
 
Old 02-10-2018, 09:37 AM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Crb999 View Post
That came as a surprise!

I don't really want you to do anything for me. I was surprised at what you did.
you don't really want me to do anything for you.
Quote:
Originally Posted by Crb999
Would you be so kind as to try the next phase, which is to add a field in the calculation sheet that is a local url. That url being in the shared directory as well. .....
that is a request from you to me to do something for you. You're contradicting yourself. you know... then playing the guilt trip thing on me next....

Quote:

I suspect they won't be maintained.

We'll never know! Shame.

Thanks anyway.
we'll never know because why, surly not by any fault of my own. They're your files. Not mine.

If you do not want to open up your app to get to your files....
Quote:
All of the biggest technological inventions created by man, the airplane, the
automobile, the computer, says little out his intelligence, but speaks volumes
about his laziness.
try :: bind mount the share into each individuals account via fstab .. then apply a shotcut to the files.

Last edited by BW-userx; 02-10-2018 at 10:03 AM.
 
Old 02-10-2018, 09:43 AM   #10
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Maybe it's a limitation from Libreoffice, see how a Libreoffice shared document work:

https://help.libreoffice.org/Common/Collaboration

It seems there are fewer options than what you planed for, ie a Libreoffice shared document is either writable for all or not shared at all.
The help document doesn't talk about document links though, maybe the linked documents have to be set as shared or not shared opening them individually (requires some testing)

On another point, Libreoffice shared document feature allows for opening the document simultaneously by different users which may be nice (or not) depending on your usage
 
Old 02-10-2018, 02:24 PM   #11
Crb999
Member
 
Registered: Jan 2017
Location: West Coast Scotland
Distribution: Suse Linux 42.2 Now 15.1
Posts: 319

Original Poster
Rep: Reputation: Disabled
Hi keefaz, yes, I suspect it is a libreoffice failing.

BTW I did set up the documents for libreoffice sharing and it worked in the way expected, opening by another user opened on a 'Read only' mode, but the urls were still not maintained.

I've given up trying to use links. BW suggested that I simply 'Open recent document'

That works and I'll stick with it for the foreseeable future.

I'll drop a line to libreoffice and see what they say.

Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Software which searches for files in shared folders of LAN connected computers pls_help_URGENT Programming 15 05-09-2013 06:27 PM
find -exec command to recursively delete files and folders in folders with X name Joan Murt Linux - Newbie 2 07-08-2009 04:35 PM
Samba can create new files and folders but access denied in any new folders k.king Linux - Networking 2 01-15-2006 06:14 AM
Shared Folders dudeman41465 Linux - Software 3 10-10-2005 03:12 AM
can't see shared printer/files/folders on windows noorania Linux - Networking 0 11-12-2003 06:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration