Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]Non-root users get "I have no name!" promp
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
seifn06
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2004
Posts: 85
Location: Lowell, Michigan

PostPosted: Tue Aug 02, 2005 3:15 pm    Post subject: [SOLVED]Non-root users get "I have no name!" promp Reply with quote

...Problem...
When I log in remotely via SSH, my prompt which is usually <username>@<hostname> <dir>$ is "I have no name!"@<hostname> <dir>$. I used the steps given at http://www.gentoo.org/proj/en/hardened/selinux/selinux-sparc64-handbook.xml?part=5&chap=3#doc_chap5 to determine that the file contexts of /etc/passwd and /etc/shadow were incorrect (using the sestatus -v command). I ran:
Code:
# restorecon /etc/passwd /etc/shadow

This correctly set the file context of the /etc/shadow file but not the /etc/passwd file which still maintains its [incorrect?] root:object_r:etc_t context.

Restarting the ssh daemon and attempting to log in with a non-root user still yields the same symptom as described above ("I have no name!"...).

...Background info...
I'm running Hardened Gentoo/SELinux with a 2.6 kernel and openssh 4.1p1.

...Questions...
(1) Is there a way to manually set the file context for a file like /etc/passwd so that I can force the passwd file to take on the proper context?
(2) Why would restorecon not give the passwd file the correct context?
(3) Does anyone have any ideas as to how the passwd file could have gotten this odd context?


Last edited by seifn06 on Tue Aug 02, 2005 6:40 pm; edited 2 times in total
Back to top
View user's profile Send private message
seifn06
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2004
Posts: 85
Location: Lowell, Michigan

PostPosted: Tue Aug 02, 2005 3:30 pm    Post subject: Reply with quote

I tried
Code:
restorecon -F /etc/passwd system_u:object_r:etc_t
and
Code:
restorecon -F system_u:object_r:etc_t /etc/passwd
, Though I think the syntax of those commands is incorrect, the /etc/passwd file now has the correct/proper context.

However, after restarting my sshd my non-root user still gets the "I have no name!"@<hostname> <dir>$ prompt...

I get no errors in the /var/log/auth.log file when my non-root user logs in. However, when I examine the /var/log/syslog file, I see the following lines:
Code:
Aug  2 11:26:35 <hostname> sshd(pam_unix)[5388]: session opened for user <non_root_username> by (uid=0)
Aug  2 11:26:39 <hostname> su(pam_unix)[5392]: session opened for user root by (uid=1000)


It appears that the uid (userid, right?) is not being interpreted/read correctly for my non-root user. (My non-root user has uid 1000.) Is this a problem and if so does it involve PAM, OpenSSH, something else?
Back to top
View user's profile Send private message
r0bertz
Retired Dev
Retired Dev


Joined: 13 Sep 2004
Posts: 257
Location: HKSAR,China

PostPosted: Tue Aug 02, 2005 6:03 pm    Post subject: Reply with quote

-rw-r--r-- 1 root root 2427 Aug 2 02:12 /etc/passwd
your passwd file should be worldwide readable
Back to top
View user's profile Send private message
seifn06
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2004
Posts: 85
Location: Lowell, Michigan

PostPosted: Tue Aug 02, 2005 6:39 pm    Post subject: Reply with quote

Ah, that solved it zhllg! I love the quick/easy fixes! Thanks for the help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum