New user creation in linux [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
Can anyone explain what exactly happens when new user is created in linux. I mean how user space is created and everything that happens internally.
what is shell space
From where home space is given etc.

The only really necessary thing is a new entry in the file /etc/passwd. That represents the list of users.
But, typically, however, there will be done some more things.
A home directory for the user is created. This is just a mkdir on a path like /home/bilbo for the user bilbo. It typically matches the user's name but it does not need to. Which belongs to which is specified in the /etc/passwd.
The user's encrypted password is added to /etc/shadow
Some files are copied from templates to that new user's home directory. This depends on the distribution you are using, but often some standard configuration things are done within that new home directory; e. g. creating directories like /home/bilbo/Pictures etc.
Sometimes also a group is created for that user, if so, then typically, that group also is named like the user. Creating a group is done by inserting an entry to the file /etc/group.
On a modern system like Ubuntu the whole user directory might be set up to be mounted from an encrypted path, but this is a special case worth a new question ;-)

Related

Why do shells look different for different users? [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 4 years ago.
Improve this question
I have a server in which there are 2 users: root and bob while I am logged in as root, everything look normal. Files are colored according to type, I can press up and down to search for previous typed commands, and I can see the current folder name in the shell prompt.
Being logged in as user bob everything seems "weird", nothing is colored, pressing up and down give me weird characters in the command line like "^[[A^[[B" and I can only see the character "$" in the command line prompt.
Is there a way to fix the issue?
Two possible features could be causing this.
The first: your two users could be using different terminals (i.e. bash, busybox, etc.)
You can change this per user in the /etc/passwd file
The second comes down to preferences, typically stored in ~/.profile, ~/.bash_rc and ~/.bash_profile. ("~" refers to the home directory for that user, also found in /etc/passwd file, typically "/home/USERNAME").

How to hide a files from Filezilla (or from directory search) [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 4 years ago.
Improve this question
What are the ways that I can hide files and folders from any directory search ?
For example :
(What I will do)
Access the remote server through putty
Then will show the files inside the folder
(What I WANT to do)
To hide the files inside those folder
(What I tried to do)
I tried to changed the file permission via FileZilla (Doesn't work)
I tried to create a new filter rules via FileZilla (It works but only hides from filezilla)
Thank you for help!
What are the ways that I can hide files and folders from any directory search ?
There is no such thing as "hiding a file".
In Windows you can set the hidden or system flag, but this doesn't actually hide the file, it's just a filter for directory search operations that choose to ignore hidden or system files.
They would be invisible to dir but completely visible to dir /ash
In *nix, files that start with a "." are not shown by default but that's also just a convention. They're not actually hidden and are just suppressed by file operations that don't want to show "dot" files.
ls would not show .mysecretfile but ls -la would show it.

How to permit securely Bob to read some file in /var/log/? [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
this is my first question here.
I'm using a Centos server.
I want to know how to permit proprely a non-sudoer user (let's call it Bob) to read a specific file in /var/log. I want to be able to read some logs without being root and without jeoparadizing my logfile.
For the moment,
I created a group named "loggers"
I added Bob to the group
I made a chgrp for the file I want to read with Bob
I changed file permissions from 600 to 640.
Is there any better (secure) way to make the same thing ?
If you're happy with a special group, then that is the way to do it. The alternative is to use ACLs, which are additive to standard unix permissions. You'd return your logfile to its original unix permissions then permit Bob with something like
setfacl -m user:Bob:r-- /var/log/mylogfile.log
There are circumstances where ACLs are unfavorable, in particular where you have file backup/migration across servers or filesystems. However, this isn't the case for your scenario.

How to store data permanently in /tmp directory in linux [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 1 year ago.
Improve this question
Is there any way to store any data in Linux tmp directory. As i know Linux clear its /tmp directory when system is rebooted. But I want to store data permanently.
Like #bereal said, this defeats the purpose of the /tmp directory. Let me quote the Linux Filesystem Hierarchy Standard:
The /tmp directory must be made available for programs that require temporary files.
Programs must not assume that any files or directories in /tmp are preserved between invocations of the program.
You'll find a better place to store permanent data.
Since it's linux you are free to do what you want to do (as root). When /tmp is cleared depends on your system and can be changed; there is no particular magic involved. A good summary seems to be here: https://serverfault.com/questions/377348/when-does-tmp-get-cleared.
Of course if you are root you can set up an entirely different global directory, say "/not-quite-tmp" or such. But I assume that some progs not under your control write to tmp and you want to inspect or in any case persist those files.
While you are trying to do wrong things, it’s still possible.
/tmp directory is cleared accordigly to TMPTIME setting. The default is apparently 0, what means “clear on every startup”.
The value might be changed in /etc/default/rcS (value is to be set in days.)

Is there a script to determine linux user name? [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 am looking for some code to get the linux username.. I have come across code to get current username but what I need to get is the username that was used when installing linux..
For example, if im logged in as root user, how can i get the initial username that was used when installing ubuntu?
Better still, Is there a variable that I can put in my script that will search & store install username..
you can use fact, that default uid and gid for first created user is 1000:
grep 1000:1000: /etc/passwd|cut -f1 -d':'
but keep in mind:
when default user was deleted, you get empty string
if it running on non standard configuration, uid, and gid may be different
this is not good practise (see next point)
you ate not considering multi-seat configurations, when station have many users, you should provide user config file, where user can put usernames he wants to processed or do it from command line

Resources