LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-31-2011, 03:32 AM   #1
FiftyOneFifty
LQ Newbie
 
Registered: Oct 2011
Posts: 14

Rep: Reputation: Disabled
Why should writing to my own home folder require elevation (Ubuntu Server 10.04)


This is my first time configuring server Linux (Ubuntu Server 10.04). So far, I have created only one user login for administration. I've noticed I can't write to my own home folder without elevating to root status. This means that almost any process I launch needs to be run with sudo, even creating a text file.

I can see that the user and group for my /home/username folder are both "root", I'm assuming there is a reason. I'm pretty sure adding my login name to the "root" group would have unintended security consequences, such as being able to edit configuration files without elevation. Can I change the owner or the group on my home folder without making those files inaccessible to system processes that expect to access them (since under Ubuntu, my user login is a surrogate root account). I.E., is there a reason editing the content of my own root folder should require elevation?
 
Old 10-31-2011, 05:23 AM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
Can you explain in more detail how you created that user? About /home subdirectories and subdirectories and files they contain - they should have owner and group of belonging user and permissions rwx for owner of course. The rest as you wish.

And what means?
Quote:
my user login is a surrogate root account

Last edited by eSelix; 10-31-2011 at 05:33 AM.
 
Old 10-31-2011, 07:14 AM   #3
Flang3r
LQ Newbie
 
Registered: Oct 2011
Distribution: Fedora, CentOS
Posts: 14

Rep: Reputation: Disabled
try

Code:
sudo chown username:username /home/username
it should change ownership of the directory to desired user account and shouldn't require elevation any more.
 
Old 10-31-2011, 08:42 AM   #4
FiftyOneFifty
LQ Newbie
 
Registered: Oct 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
Flang3r: Right, I understand I can change ownership, I just wanted to ask if there was any reason I shouldn't. eSelix: What I mean by surrogate is that root logins are disabled in Ubuntu, any user in the sudoers can get root privileges provided they have the password. Since there is no /root folder, I wanted to make sure it is OK to tinker with privileges in my own home folder. It's the account that was created when I installed the system.
 
Old 10-31-2011, 08:53 AM   #5
Flang3r
LQ Newbie
 
Registered: Oct 2011
Distribution: Fedora, CentOS
Posts: 14

Rep: Reputation: Disabled
Actually it is strange, when you create an account when installing system, home folder always belongs to that user. Maybe you were doing something that required root access, switched to the root user, accidently or on purpose, deleted user's home folder and then recreated it?

Afaik there is no reason not to change user joe's homedir's ownership to joe
 
Old 10-31-2011, 03:05 PM   #6
FiftyOneFifty
LQ Newbie
 
Registered: Oct 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
Flang3r: No, never deleted the original account. The only odd thing I've done is mount an external SATA drive at /home . The box is a pre-owned HP Prolient dual Xeon DL-380 Gen 3 rack mount. Rather than add additional SCSI drives (this is for home experimental use), I had a PCI-X compatible SATA controller and a 750Gb drive I never got to work on my old P4s. I'm powering it for now from the external brick from one of those IDE/laptop_IDE/SATA to USB test adapters (if anybody knows how to access +5 and +12 rails inside a rack server, I would be grateful). I'm pretty sure I was having this problem before I plugged in, partitioned, formatted, and mounted the drive, but I'm not sure. Thanks for verifying it won't hurt to take ownership of my own home folder.
 
Old 10-31-2011, 03:10 PM   #7
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
root logins are disabled, but account is fully functional, for example some services start as root, you can "su" (switch user) to root, etc. If you have no /root folder it can be wrong if in /etc/passwd file this directory is written as home for root, because some programs working on root account possibly may need to use his home folder.

As you see, incorrect permissions in user home directory lead to problems. You need to change ownership of these directories and its content to proper user (like Flang3r wrote but also give -R option for recursion). And when root create file or directory in user folder he should take care to change its ownership and/or permissions, without that only root can write to it.
 
  


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] rsync always writing backup to /home/ on remote server HellesAngel Linux - Networking 6 02-16-2011 08:26 AM
Deleted User Lost Home Folder need recoverd Ubuntu wizard210 Linux - Desktop 3 02-06-2011 03:43 PM
[SOLVED] Slackware/Ubuntu machine /home/_ folder? Vi3GameHkr Linux - Newbie 9 01-11-2011 01:45 PM
Why Samba Server is sharing my Home folder? baig Linux - Security 2 12-18-2008 07:59 PM
Writing to a shared home folder confused_bof Linux - Networking 5 05-18-2004 06:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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