LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 08-23-2016, 10:26 PM   #1
Tukatz
Member
 
Registered: Apr 2014
Location: B.C. Canada
Distribution: Ubuntu14.04Trusty, Ubuntu 16.04.1
Posts: 80

Rep: Reputation: Disabled
File sharing: admin to guest


I am setting up a desktop operation for a small library. The O/S is Ubuntu 16.04. When guests log in there is a box that opens and informs the guest that upon log-out all their files or what ever work they have done will be deleted and that they should save any important material to an external device. 1st off I cannot seem to disable that. 2nd: The admin (librarian) would like to make files such as a list of books currently in-house available to guests (read only)in the guest login without them accessing all her files. The system seems to suggest it is possible to share such files between the Admin account and the guest account on the same computer but I cannot find a way to do that. Is it possible and if so how do I set that up?
Is this common to all operating systems or is it unique to Linux? Tukatz
 
Old 08-23-2016, 10:44 PM   #2
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732
You want to disable the message about all files being deleted, or you want to disable all files from being deleted? I assume the former, but do clarify.

You can certainly share files on Linux as read-only. Since it's on the same computer, all you have to do is grant READ access to a directory (and the file or files in it) and the guest will be able to see the files without ever having the ability to delete or alter them.

I've done this in the past by making a special folder in /home, or /opt, or even / (root partition). It's up to you. Here's an example:

Code:
$ sudo mkdir /library
$ sudo chmod 744 /library
Then the librarian can copy files to that location. As long as the files have 744 permissions (rwx r-- r--), the guest can see the files.

You'll probably want these files to be obvious to the guest. For that, you might make links (aliases) to them someplace obvious (like the desktop). You can do that by customising the default guest account:

https://help.ubuntu.com/community/CustomizeGuestSession
 
1 members found this post helpful.
Old 08-23-2016, 11:46 PM   #3
Tukatz
Member
 
Registered: Apr 2014
Location: B.C. Canada
Distribution: Ubuntu14.04Trusty, Ubuntu 16.04.1
Posts: 80

Original Poster
Rep: Reputation: Disabled
File sharing: admil to guest

Hi, thanks for the quick response. What I would like to do in the guest login is to eliminate the message about deleted files, and I would also like to change the system so that guests may be able to save files on the guest account. The main thing though is for guests to be able to access as read only, certain files such as mentioned books available in house while in the guest account. I attempted to change permissions in both the admin account as well as in the guest account, I tries file sharing, setting parameters such as "access only", "read only" and so on but none of them worked when I attempted to access a test file from the admin account to the guest account. I will give your advice a try. Hopefully I can achieve the desired results. Thanks, Tukatz
 
Old 08-24-2016, 02:06 AM   #4
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Sometimes, the easiest method is to use the terminal, rather than GUI tools (if you know what to enter). The basic problem is that what you really want is NOT "file sharing", you just don't know it yet. File sharing is generally talking about sharing things over a network, rather than among users on a single computer.

I don't really know what sort of customizations Ubuntu has in place for its guest account feature, but that CustomizeGuestSession seems to be a good reference for how to do what you want. You just need to be aware that you do NOT want "file sharing". Rather, you want to just create two folders with the desired access rights and you want to create symbolic links to those folders so they'll show up in a guest session.

The two folders could be, for instance, /home/readonly and /home/readwrite. The former is where you want to put the shared files (read only access). The latter is where you let guests save files for future use read write access, but bear in mind any guest can access and mess with what any other guest saves here. If you want more privacy and protection, you'll have to bite the bullet and create user accounts for individuals.)

Create those folders with:

Code:
sudo mkdir /home/readonly
sudo mkdir /home/readwrite
You can see the owner of the file and the access rights with the command:

Code:
ls -l /home
I'm not 100% sure of how Ubuntu does things (I mainly use the Debian operating system Ubuntu is based on), so I'm not sure if it will be necessary to change the owner to the admin account. If you see something like the following, then you want to change it:

drwxr-xr-x 31 root root 4096 Aug 24 01:21 readonly

The command to change it is:
Code:
sudo chown admin:admin /home/readonly
That code assumes the userid of the admin account is "admin". Adjust accordingly. The result should be that running "ls -l /home" shows you something like this:

drwxr-xr-x 31 admin admin 4096 Aug 24 01:21 readonly

Basically, you want the owner of the "readonly" folder to be the librarian user.

Now you can change the access rights with:

Code:
sudo chmod 755 /home/readonly
sudo chmod 777 /home/readwrite
Eventually, you'll learn the ins and outs of chmod, but for now all you need to know is this:

755 => drwxr-xr-x = the owner has read-write-execute(descend) rights; others have only read-execute(descend) rights
777 => drwxrwxrwx = everyone has read-write-execute(descend) rights

To make these folders easier to find, you can create symbolic links in, say, the ~/Documents folder. When logged in as the admin account, create these links with:

Code:
cd ~/Documents
ln -s /home/readonly
ln -s /home/readwrite
Making such links for an Ubuntu guest account is a matter of creating such links in /etc/guest-session/skel (as per the link provide above). Do this with:
Code:
sudo mkdir /etc/guest-session
sudo mkdir /etc/guest-session/skel
sudo mkdir /etc/guest-session/skel/Documents
cd /etc/guest-session/skel/Documents
ln -s /home/readonly
ln -s /home/readwrite
I'm not 100% sure the above block will work exactly right. I've never messed with Ubuntu guest accounts, I'm just going by the documentation in that link and adding my own little bit.

Last edited by IsaacKuo; 08-24-2016 at 02:07 AM.
 
Old 08-25-2016, 04:42 PM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
The default guest account on Ubuntu is extremely limited. In additon to what you have posted, you can't switch to another user and you can't use sudo. If you want to modify the defualt settings that is explained in the Ubuntu documentation at the link below.

https://help.ubuntu.com/community/CustomizeGuestSession
 
Old 08-28-2016, 12:39 AM   #6
Tukatz
Member
 
Registered: Apr 2014
Location: B.C. Canada
Distribution: Ubuntu14.04Trusty, Ubuntu 16.04.1
Posts: 80

Original Poster
Rep: Reputation: Disabled
Thanks for all the tips folks. Unfortunately I was not able to achieve my goal but plans have changed in the long run. We have decided to go with an on-line system so guests can access the library catalog from home, mobile devices or the guest login on the library computer. Tukatz
 
  


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
LXer: Sharing Admin Privileges for Many Hosts Securely LXer Syndicated Linux News 0 01-28-2015 08:10 PM
[SOLVED] Qemu-kvm file sharing Linux host Xp guest problems Linux.tar.gz Linux - Virtualization and Cloud 6 11-23-2010 05:57 AM
VirtualBox Slackware guest on Win7 host -- folder sharing R_Shackleford Slackware 3 07-15-2010 11:29 AM
Printer sharing between Linxu host and XP guest hikerguy Linux - Networking 5 01-10-2009 09:06 AM
Samba sharing guest and user(homes) directories monkeyfoo Linux - Networking 4 05-02-2006 02:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 01:32 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