How to change default path of a user in Unix? [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
How can we change the default path of a user in the Unix?
Suppose i have created the user Rookie.The default path of this user as shown in /etc/passwd file is /home/Rookie.
Can i change the default path of this user to /home/Rookie/release/logs?

use usermod
example:
usermod -m -d /path/to/new/home/dir userNameHere

usermod -m -d /path/to/new/login/home/dir user
This shall change existing user home directory to a new login directory. option -m moves the contents of the current home directory to the new home dir
for more information issue man usermod
hope this help!
UPDATE 1:
Also see the link: http://www.cyberciti.biz/faq/howto-change-default-home-directory/ for better explanation.

Related

Linux Terminal: Create directory and subdirectories command [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I a little bit confused..
if in case i don't have any directory
and then I want to make a new directory with subdirectories
for example I want to make a directory named A and subdirectories B and C
can I directly use :
mkdir -p A/B A/C
or must I use
mkdir -p A A/B A/C
which is the right one?
Thank you
As mentioned in my comment, -p tells mkdir to create the parent directory/ies if it does not exist. So in your case A is created when the subdirectory is created.
Therefore:
mkdir -p A/B A/C

Convert file or directory to symbolic link and preserve permissions [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have /home/eric/public_html with drwxr-x--- eric:nobody as the mod and ownership.
I login with eric so I cannot recreate this folder without root access, since eric is not part of the nobody group.
I want to replace my public_html with a symbolic link (i.e. ln -s ~/git/project/src ~/public_html) but if I do that, my new public_html ends us without the correct permissions.
Is there a trick to get around this without contacting my admin?
Possibly by doing the following:
Copy everything from ~/git/project/src into ~/public_html
mv ~/git/project/src ~/git/project/src2 to get it out of the way
mv ~/public_html ~/git/project/src
finally link it back: ln -s ~/git/project/src ~/public_html
The idea is to keep the original public_html directory because it has the correct owner/permissions, but reuse it as the link target.

Why i am not able to log into user Santosh? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I tried to channge the user from root to Santosh but i am not able to do so.
[root# localhost ~] # su -santosh
-bash-3.1 $
If you look at the su(1) man page, you can see that you are running
su -s antosh
which tries to switch to root using the shell antosh. This is probably not what you want. To change the user to santosh do:
su santosh
or if you want to run a login shell
su -l santosh
or
su - santosh
The space after - is very important.

How to add a user without using the 'useradd' or 'adduser' commands in RHEL6.3? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I want to add a user in a RHEL6.3 OS without using useradd or adduser command.
I know that I have to edit in 4 files i.e passwd, group, shadow and gshadow.
But please tell me what exactly I have to edit?
Still not recommend to create a new user manually, but you can follow below steps to do it. For example, you need create a new user user3185704
(before edit, backup /etc/passwd, group, shadow)
edit /etc/passwd, add below line:
user3185704:x:100:1000:user3185704,,:/home/user3185704:/bin/bash
if group (gid=1000) is exist, no need update /etc/group , otherwise, add a new group line in /etc/group.
add below line in /etc/shadow
user3185704::::::::
create home directory
mkdir /home/user3185704
chown 100:1000 /home/user3185704
set password
password /home/user3185704
manually test you can login
su - user3185704

changing users default login shell on RHEL? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Here is a command on free bsd
sudo pw usermod ksbuild -s /usr/local/bin/bash
how do I do the equivalent on RHEL?
chsh
(Change Shell)
Or for just a specific user:
usermod -s /usr/local/bin/bash ksbuild
To change the default setting of all new users, edit the setting in the defaults file:
/etc/default/useradd

Resources