LinuxQuestions.org
Help answer threads with 0 replies.
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 05-07-2012, 10:58 PM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 37
Question regarding changing home directory?


We are using a separate non-root user for executing script say abc.
login with this user is only intend to create and execute the script.

All the scripts are stored at location /usr/local/sbin

Is it recommended to change the home directory of user to /usr/local/sbin ?

or shall i edit bash profile ?

Which one is more preferred?


this is to save some time
 
Old 05-08-2012, 01:07 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
If(!) all the user does is run the app directly, then doing that+making the app the 'login shell' would work, if you set it up correctly.
On the other hand, if more flexibility is required eg user needs to do other stuff related to it, then your orig idea ie just make it the home dir would work.
In fact, providing you give the user/app a unique uid+gid ie not shared by anyone else, then giving him a std login would be ok, & possibly easier to manage.
 
Old 05-09-2012, 01:22 AM   #3
pinga123
Member
 
Registered: Sep 2009
Posts: 684

Original Poster
Blog Entries: 2

Rep: Reputation: 37
Quote:
Originally Posted by chrism01 View Post
In fact, providing you give the user/app a unique uid+gid ie not shared by anyone else, then giving him a std login would be ok, & possibly easier to manage.
Not able to understand the concept behind the same. Can you please explain how will it be easier to manage.
Why there is need of giving user and app a unique uid+gid. I think uid and gid are associated with user .How they are related to script .Are you talking about access privileges on file such as rwx?

Btw all the scripts are created with this user only so basically uid gid of scripts are as same as the user.

So considering all this making home directory of user a /usr/local/sbin makes more sense.

Last edited by pinga123; 05-09-2012 at 06:52 AM.
 
Old 05-09-2012, 08:12 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
In general management terms, if all users have their home in eg /home, then you don't have to worry about exceptions when you are doing system management type stuff.
You may also end up with other apps/users using /usr/local/sbin for other stuff.
Usually best to physically separate a person's home dir from prodn code imho.
So long as the uid/gid is unique, that should be enough (remove other/world perms).
 
  


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
Changing home directory neo_philiac Programming 1 02-10-2009 01:14 PM
changing home directory manoj.linux Linux - Enterprise 3 08-21-2007 08:44 AM
changing home directory peaceslp Linux - General 1 12-09-2005 07:13 AM
Changing the home directory kyleinc Linux - General 2 02-26-2005 11:54 PM
changing home directory netboy_541 Linux - General 5 09-10-2003 04:09 AM

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

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