LinuxQuestions.org
Visit Jeremy's Blog.
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, 11:58 PM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 36
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, 02:07 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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, 02:22 AM   #3
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
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 07:52 AM.
 
Old 05-09-2012, 09:12 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 10:09 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration