Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

comment in /etc/passwd and /etc/group

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
3 posts • Page 1 of 1
Author
Message
chaonis
n00b
n00b
Posts: 36
Joined: Tue Apr 05, 2005 1:26 am

comment in /etc/passwd and /etc/group

  • Quote

Post by chaonis » Fri Nov 03, 2006 1:06 am

I am wondering if I can put comments in /etc/passwd and /etc/group files by starting the line with "#" character, like many other files do.

Checked the man pages for both files and googled but don't see it mentioned anywhere.

Can I do it? Will it cause any issue for the system to parse the line? Most importantly, will it hurt the secruity of the system?

--
C
Top
timeBandit
Bodhisattva
Bodhisattva
User avatar
Posts: 2719
Joined: Fri Dec 31, 2004 1:54 am
Location: here, there or in transit

  • Quote

Post by timeBandit » Fri Nov 03, 2006 1:54 am

Interesting question. :o

I don't have a definitive answer, but my routine daily travels have taken me through AIX, Solaris, HP-UX, five Linuxen and at least one other forgotten UNIX over the years, and I don't think I ever saw commented password or group files on any of them. I'd be leery of doing so since they're essentially delimited text databases. A comment would be an invalid "record" IMO, absent any information from a trusted source.

The shadow suite is a further complication. It might be upset by lines in /etc/passwd that had no counterparts in /etc/shadow.
Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others.
Top
dev-urandom
Apprentice
Apprentice
User avatar
Posts: 260
Joined: Fri Jun 24, 2005 11:12 am
Location: Huh?

Re: comment in /etc/passwd and /etc/group

  • Quote

Post by dev-urandom » Fri Nov 03, 2006 8:04 am

chaonis wrote:I am wondering if I can put comments in /etc/passwd and /etc/group files by starting the line with "#" character, like many other files do.
Checked the man pages for both files and googled but don't see it mentioned anywhere.
Can I do it? Will it cause any issue for the system to parse the line? Most importantly, will it hurt the secruity of the system?
Don't ever do this. There is no space for comments in /etc/passwd. Call it a design shortfall from 30 years ago if you want, but that it where we are. In fact, if you change

Code: Select all

foobar:x:1000:1000:Foo Bar:/home/foobar:/bin/bash
to

Code: Select all

#foobar:x:1000:1000:Foo Bar:/home/foobar:/bin/bash
all you'll get is a user #foobar. Try it out if don't believe me ;)
/earth: file system full.
Top
Post Reply

3 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic