LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-07-2007, 12:07 AM   #1
linuxgentoo
LQ Newbie
 
Registered: Nov 2007
Location: Shanghai,China
Distribution: gentoo
Posts: 19
Blog Entries: 1

Rep: Reputation: 0
su shell-init: error retrieving current directory: getcwd: cannot access parent direc


i am root,in /root dir and i wana to su another common user,
it tell me the message as the title

i know the reason the /root dir mode is 0700

i wana to know where is the error message from?which function be called by su?




thanks
 
Old 11-07-2007, 12:19 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Don't start out as the root user. You are su'ing to a user how doesn't have access to the directory you are in. CD to / or /home before becoming that user. The permissions on the /root directory are correct. Don't change them.

If you start out as a regular user, and "su -" to root only when you need to perform adminstrative functions, exit back to the original user. You will be returned to the directory you were in before running "su -".
 
Old 11-07-2007, 12:24 AM   #3
linuxgentoo
LQ Newbie
 
Registered: Nov 2007
Location: Shanghai,China
Distribution: gentoo
Posts: 19
Blog Entries: 1

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jschiwal View Post
Don't start out as the root user. You are su'ing to a user how doesn't have access to the directory you are in. CD to / or /home before becoming that user. The permissions on the /root directory are correct. Don't change them.

If you start out as a regular user, and "su -" to root only when you need to perform adminstrative functions, exit back to the original user. You will be returned to the directory you were in before running "su -".

thank you,i know i can use "su -"
but in gentoo,ubuntu linux distribution,i run it in the same way
it doesn't give this message


-------------------------------------------------------
localhost ~ # pwd
/root
localhost ~ # ls -ld /root
drwx------ 29 root root 4096 2007-11-07 14:23 /root
localhost ~ # su lynn
lynn@localhost /root $ cat /proc/version
Linux version 2.6.22-gentoo-r5 (root@localhost) (gcc version 3.3.6 (Gentoo 3.3.6-r1 p1.4, ssp-3.3.6-1.0, pie-8.7.8)) #5 SMP Fri Nov 2 14:46:00 GMT 2007
 
Old 11-07-2007, 01:07 AM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
In Ubuntu, root logins are disabled so that may make a difference.
 
Old 11-07-2007, 01:19 AM   #5
linuxgentoo
LQ Newbie
 
Registered: Nov 2007
Location: Shanghai,China
Distribution: gentoo
Posts: 19
Blog Entries: 1

Original Poster
Rep: Reputation: 0
up

hope to know what happen behind the code
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grabbing the current directory in shell script binarybob0001 Programming 4 11-02-2007 06:03 PM
Problem with X consoles - "shell-init: error retrieving current directory" lowpro2k3 Slackware 4 03-26-2007 06:36 PM
init Parent Process ID sobia Linux - General 1 06-09-2006 10:28 PM
symlink-hook: error retrieving current directory: getcwd: cannot access parent dire sailu_mvn Linux - Software 1 03-09-2006 06:01 AM
New process w/o current parent? novaprime Programming 2 01-04-2005 09:06 PM


All times are GMT -5. The time now is 09:53 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration