Sponsored Content
Full Discussion: home vs user
Top Forums Shell Programming and Scripting home vs user Post 302262434 by pjottum on Thursday 27th of November 2008 09:55:16 AM
Old 11-27-2008
Quote:
Originally Posted by qfwfq
Tks, but that is giving me exactlly the same as my script, I am looking for all home dir that do not have a user in /etc/passwd
But that's exactly what the script produces, all dirs in .home that do not have an entry in /etc/passwd. I've tested it now Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

resrtrict user to his home directory

Hello How do i restrict a user only to his own directory so that he wont be able to cd to other directories. say for excample there is user called xiamin then xiamin should be restricted to /usr/xiamin only. i am on redhat linux regards Hrishy (4 Replies)
Discussion started by: xiamin
4 Replies

2. UNIX for Dummies Questions & Answers

Locking in user to $HOME

Is there a very easy and configurable method to lock a user into their home directory? I've checked on chroot() methodology.....but i'm not to excited about copying around ( or symlinking) libraries..binaries....etc. Thought about altering the groups via chgrp...to only allow read access to... (1 Reply)
Discussion started by: thomas.jones
1 Replies

3. UNIX for Dummies Questions & Answers

Modify user home dir

I created a new user and assigned a certain home dir to tis user. I've noticed that this home dir (/export/home/test) is already assigned to other users. I really want to create a dedicated home dir for the new user. Can anyone tell me how I can modify this user with a new homedir? Thx for... (4 Replies)
Discussion started by: kris_devis
4 Replies

4. Solaris

need to restrict user to his home dir

Hello, i need to create a user who's access is restricted only to his home directory and below, i restricted his pty access by adding 'no-pty' to the options of the ssh key in authorized_keys file. However, sftp access still allows this user access to all my file system thanks (5 Replies)
Discussion started by: lidram
5 Replies

5. Shell Programming and Scripting

how to find out the home directory of a user??

Hi all, I would like to know how to find out the home directory of a particular user.. eg, If am the root , then my Home directory will be / if say am just a user logging into the terminal then my home dir would change, so accordingly i would like to know how to find it out... I know that... (7 Replies)
Discussion started by: wrapster
7 Replies

6. AIX

/home belongs to a user?

While doing a "little" clean up job, i noticed something weird... A ls -altr of my / showed this: drwxr-xr-x 1549 johcham grands 102400 Jan 28 13:13 home How can a user become the owner / modify the group of my /home??? any thoughts? Can i chown this back to bin:bin (i think that... (2 Replies)
Discussion started by: Stephan
2 Replies

7. Red Hat

User's home directory

Hi, By default user's home directory will be /home/$user. I want to change it to /javauser/$user. How can I do it? Thanks Jeevan. (5 Replies)
Discussion started by: jredx
5 Replies

8. Solaris

how to change /export/home/user dir to /home /user in solaris

Hi all i am using solaris 10, i am creating user with useradd -d/home/user -m -s /bin/sh user user is created with in the following path /export/home/user (auto mount) i need the user to be created like this (/home as default home directory ) useradd -d /home/user -m -s /bin/sh... (2 Replies)
Discussion started by: kalyankalyan
2 Replies

9. Solaris

Home Directory for oracle user

Hello all, I am Installing Oracle 11g on my Solaris OS. I created the below oracle user: # /usr/sbin/useradd -g oinstall -G dba oracle but when i am trying to to su - oracle it give me the below error No directory Do i have to setup a home directory for oracle user? and how can i do... (1 Reply)
Discussion started by: beayni33
1 Replies

10. UNIX for Dummies Questions & Answers

Switching from root to normal user takes me to user's home dir

Whenever i switch from root to another user, by doing su - user, it takes me to home directory of user. This is very annoying as i want to be in same dir to run different commands as root sometimes and sometimes as normal user. How to fix this? (1 Reply)
Discussion started by: syncmaster
1 Replies
GETPWENT(3)						     Linux Programmer's Manual						       GETPWENT(3)

NAME
getpwent, setpwent, endpwent - get password file entry SYNOPSIS
#include <pwd.h> #include <sys/types.h> struct passwd *getpwent(void); void setpwent(void); void endpwent(void); DESCRIPTION
The getpwent() function returns a pointer to a structure containing the broken out fields of a line from /etc/passwd. The first time it is called it returns the first entry; thereafter, it returns successive entries. The setpwent() function rewinds the file pointer to the beginning of the /etc/passwd file. The endpwent() function closes the /etc/passwd file. The passwd structure is defined in <pwd.h> as follows: struct passwd { char *pw_name; /* user name */ char *pw_passwd; /* user password */ uid_t pw_uid; /* user id */ gid_t pw_gid; /* group id */ char *pw_gecos; /* real name */ char *pw_dir; /* home directory */ char *pw_shell; /* shell program */ }; RETURN VALUE
The getpwent() function returns the passwd structure, or NULL if there are no more entries or an error occurs. ERRORS
ENOMEM Insufficient memory to allocate passwd structure. FILES
/etc/passwd password database file CONFORMING TO
SVID 3, BSD 4.3 SEE ALSO
fgetpwent(3), getpwnam(3), getpwuid(3), getpw(3), putpwent(3), passwd(5) GNU
1996-05-27 GETPWENT(3)
All times are GMT -4. The time now is 08:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy