Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support NIS created users without a home directory Post 302903449 by Junaid Subhani on Tuesday 27th of May 2014 04:57:08 PM
Old 05-27-2014
It just went crazy :/

Code:
[root@Barium home]# service autofs stop
Stopping automount:                                        [  OK  ]
[root@Barium home]# rm -rf /home
[root@Barium home]# service autofs start
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Starting automount:                                        [  OK  ]
[root@Barium home]# su - nisuser
su: warning: cannot change directory to /home/nisuser: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
-bash-4.1$

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Profiles for users without home directory

Hi I want to know which profile will be called when a user without home directory is created. When I created a user without home directory(by setting in /etc/default/useradd), the user is able to login directly into the main "/" folder but with only read permissions. Thanks naina (3 Replies)
Discussion started by: naina
3 Replies

2. UNIX for Dummies Questions & Answers

Home Directory Jail for Users

Hi, I am looking for a shell script (or any other way), that puts a user in a home directory jail. So for example, I have a user named richard and I don't want him wandering outside /usr/users/richard. I don't want him to cd to anywhere including cd .. Somebody said you can do that with... (3 Replies)
Discussion started by: mz043
3 Replies

3. UNIX for Advanced & Expert Users

Problem: Automounting Home directory for nis & nfs configuration doesn't work

Hi all, First of all, i am so sorry about my bad level in English writing. I have some problem in linux and i hope the experts of this forum to help me if they have enough time to reply to me. I have a scenario of configuring NIS and NFS in Redhat Linux environment such that user can login... (0 Replies)
Discussion started by: pioneer
0 Replies

4. UNIX for Dummies Questions & Answers

lost /home/directory for users

I'm using HPUX 11i. The other day a user logon to the workstation and was not able to find the /home/directory (tom is the directory) I login myself and it is the same thing. The home directory is on the server, so I was thinking of using sam to map it again. does anyone know how to do it... (5 Replies)
Discussion started by: blizzgamer
5 Replies

5. Solaris

Common Home directory for different users??

Hi Guys, I have a problem with configuring a server. this is a solaris 10 with sparc platform. I have setup so that the server is Authenticating through NIS but I dont want the server to Mount the Home directories. The users need to logged in through the CDE/display. I have over 200 users... (2 Replies)
Discussion started by: Luky
2 Replies

6. UNIX for Advanced & Expert Users

about the access permission of users home directory

RHEL5.0 As we know, when root create a new user, a new home directory will be created : /home/user I want to know what determine the access permission of /home/user . Thanks! (1 Reply)
Discussion started by: cqlouis
1 Replies

7. Red Hat

SSH lock users to the Home Directory

Hi friends, I must to give ssh connection to own customer. So I want to lock ssh user on own home directory. It is not necessery to reach other folders. I know that ftp user can lock on own folder but I don't know how to lock ssh user. I am waitting your kindly helps :D ---------- Post... (10 Replies)
Discussion started by: getrue
10 Replies

8. UNIX for Dummies Questions & Answers

User's home directory not being created

I am trying to create Oracle user. I will install oracle after that. But my problem is /home/oracle directory is not being created. bash-3.2# useradd -g oinstall -G dba,oper -d /home/oracle -m oracle cp: /home/oracle: Operation not applicable chown: /home/oracle: No such file or directory ... (3 Replies)
Discussion started by: hubatuwang
3 Replies

9. UNIX for Advanced & Expert Users

Permissions on a directory in /home for all users

Hi, I have created a shared directory on /home, where all users on a certain group have read, write and execute permissions. I did this using chmod -R g+rwx /home/shared/ The problem is, when a particular user creates a directory within /home/shared, other users are not able to write to... (8 Replies)
Discussion started by: lost.identity
8 Replies

10. HP-UX

How to set variable for users with no home directory?

Hi I need to set $HISTFILE for a user with no home directory. How to go about it because this user does not have a .profilefile. (5 Replies)
Discussion started by: fretagi
5 Replies
getcwd(3C)						   Standard C Library Functions 						getcwd(3C)

NAME
getcwd - get pathname of current working directory SYNOPSIS
#include <unistd.h> char *getcwd(char *buf, size_t size); DESCRIPTION
The getcwd() function places an absolute pathname of the current working directory in the array pointed to by buf, and returns buf. The pathname copied to the array contains no components that are symbolic links. The size argument is the size in bytes of the character array pointed to by buf and must be at least one greater than the length of the pathname to be returned. If buf is not a null pointer, the pathname is stored in the space pointed to by buf. If buf is a null pointer, getcwd() obtains size bytes of space using malloc(3C). The pointer returned by getcwd() can be used as the argu- ment in a subsequent call to free(). RETURN VALUES
Upon successful completion, getcwd() returns the buf argument. Otherwise, the function returns a null pointer and sets errno to indicate the error. ERRORS
The getcwd() function will fail if: EINVAL The size argument is equal to 0. ERANGE The size argument is greater than 0 and less than the length of the pathname plus 1. The getcwd() function may fail if: EACCES A parent directory cannot be read to get its name. ENOMEM Insufficient storage space is available. EXAMPLES
Example 1: Determine the absolute pathname of the current working directory. The following example returns a pointer to an array that holds the absolute pathname of the current working directory. The pointer is returned in the ptr variable, which points to the buf array where the pathname is stored. #include <stdlib.h> #include <unistd.h> ... long size; char *buf; char *ptr; size = pathconf(".", _PC_PATH_MAX); if ((buf = (char *)malloc((size_t)size)) != NULL) ptr = getcwd(buf, (size_t)size); ... USAGE
Applications should exercise care when using chdir(2) in conjunction with getcwd(). The current working directory is global to all threads within a process. If more than one thread calls chdir() to change the working directory, a subsequent call to getcwd() could produce unex- pected results. EXAMPLES
Example 2: Printing the current working directory The following example prints the current working directory. #include <unistd.h> #include <stdio.h> main() { char *cwd; if ((cwd = getcwd(NULL, 64)) == NULL) { perror("pwd"); exit(2); } (void)printf("%s ", cwd); free(cwd); /* free memory allocated by getcwd() */ return(0); } ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
chdir(2), malloc(3C), attributes(5), standards(5) SunOS 5.10 18 Oct 2004 getcwd(3C)
All times are GMT -4. The time now is 10:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy