Hi.
Is there any problem if I edit /etc/passwd file ?
Which vi command (or another command) can I use to
find hidden characters in this file ?
Thanks to all.
|
|
0
|
|
|
|
Reply
|
apogeusistemas
|
5/20/2008 10:40:31 PM |
|
apogeusistemas@gmail.com wrote:
> Hi.
>
> Is there any problem if I edit /etc/passwd file ?
>
> Which vi command (or another command) can I use to
> find hidden characters in this file ?
>
> Thanks to all.
use the readonly view command
$ view /etc/passwd
and
:set list
this will show characters.
:set nolist
reverts
/Jorgen
|
|
0
|
|
|
|
Reply
|
Jorgen
|
5/20/2008 10:51:53 PM
|
|
apogeusistemas@gmail.com wrote:
> Hi.
>
> Is there any problem if I edit /etc/passwd file ?
>
> Which vi command (or another command) can I use to
> find hidden characters in this file ?
>
> Thanks to all.
There is a risk to editing /etc/passwd! Vi does NOT lock the file! If
someone else is changing something in /etc/passwd, one or both of you
are going to get screwed! The risk, on a single user workstation is
just about zero. On a multiuser system it's a crapshoot!!! There IS a
way to lock /etc/passwd and/or /etc/shadow which I never used; I never
need it!
This was discussed either here or on comp.sys.sun.admin two or three
months ago. You could try googling for it or you could rtfm to find out
what it is. Or maybe some kind person will pop up and tell you.
|
|
0
|
|
|
|
Reply
|
Richard
|
5/20/2008 11:00:04 PM
|
|
apogeusistemas@gmail.com wrote:
> Hi.
>
> Is there any problem if I edit /etc/passwd file ?
>
> Which vi command (or another command) can I use to
> find hidden characters in this file ?
>
> Thanks to all.
If your system has it try 'vipw' command.
If not, first make a copy of passwd and shadow,
then edit the copies.
When done, run 'pwck passwd.copy shadow.copy'.
If everything is good, replace the originals with the copies.
If using 'vipw' you should still run 'pwck' when done (no
options needed in this case), before re-booting!
But this hand editing shouldn't be needed to change one (or a
small number of) password(s). You need to read the Solaris
man page for the passwd command. Please note if not using
the files /etc/passwd or /etc/shadow, editing those files
won't solve your problem. You need to determine if your
host uses files, NIS/NIS+/LDAP/Kerberos instead, and update
the relevant password database. With the correct options
I believe the passwd command should do that correctly.
-Wayne
|
|
0
|
|
|
|
Reply
|
Wayne
|
5/20/2008 11:20:23 PM
|
|
Richard B. Gilbert wrote:
> apogeusistemas@gmail.com wrote:
>> Hi.
>>
>> Is there any problem if I edit /etc/passwd file ?
>>
>> Which vi command (or another command) can I use to
>> find hidden characters in this file ?
>>
>> Thanks to all.
>
> There is a risk to editing /etc/passwd! Vi does NOT lock the file! If
> someone else is changing something in /etc/passwd, one or both of you
> are going to get screwed! The risk, on a single user workstation is
> just about zero. On a multiuser system it's a crapshoot!!! There IS a
> way to lock /etc/passwd and/or /etc/shadow which I never used; I never
> need it!
>
> This was discussed either here or on comp.sys.sun.admin two or three
> months ago. You could try googling for it or you could rtfm to find out
> what it is. Or maybe some kind person will pop up and tell you.
There is a library call for this, lckpwdf(3) ("LoCK PassWord Files"?).
Since several files are involved this creates /etc/.lckpwdf if missing
and locks/unlocks that.
AFAIK there is no user-level command to lock these, which comes up
on this group every few months when someone wants to create a non-interactive
script to update password data safely (as possible). (There is no
good way.)
-Wayne
|
|
0
|
|
|
|
Reply
|
Wayne
|
5/20/2008 11:31:20 PM
|
|
In article <48335c8b$0$12971$4c368faf@roadrunner.com>,
Wayne <nospam@all4me.invalid> wrote:
>apogeusistemas@gmail.com wrote:
>If your system has it try 'vipw' command.
I use the vipw command, which lives in /usr/ucb/vipw. A default installation
of S10 or Nevada or OpenSolaris should include the /usr/ucb commands.
--
Daniel L. McDonald - Solaris Security & Networking Engineering
Mail: danmcd@sun.com | * MY OPINIONS ARE NOT NECESSARILY SUN'S! *
35 Network Drive Burlington, MA |"rising falling at force ten
http://blogs.sun.com/danmcd/ | we twist the world and ride the wind" - Rush
|
|
0
|
|
|
|
Reply
|
danmcd
|
5/20/2008 11:46:39 PM
|
|
On Tue, 20 May 2008 19:31:20 -0400
Wayne <nospam@all4me.invalid> wrote:
> AFAIK there is no user-level command to lock these, which comes up
> on this group every few months when someone wants to create a
> non-interactive script to update password data safely (as possible).
> (There is no good way.)
What's wrong with `EDITOR=/foo/script.sh vipw`?
--
Andrew Deason
adeason2@uiuc.edu
|
|
0
|
|
|
|
Reply
|
Andrew
|
5/21/2008 4:07:40 AM
|
|
Wayne <nospam@all4me.invalid> wrote:
> If your system has it try 'vipw' command.
> If not, first make a copy of passwd and shadow,
> then edit the copies.
>
> When done, run 'pwck passwd.copy shadow.copy'.
> If everything is good, replace the originals with the copies.
And if the system had changed a password or made changes since you
copied the files, you've just nuked those changes.
--
Darren
|
|
0
|
|
|
|
Reply
|
ddunham
|
5/21/2008 6:14:01 AM
|
|
Darren Dunham wrote:
> Wayne <nospam@all4me.invalid> wrote:
>> If your system has it try 'vipw' command.
>> If not, first make a copy of passwd and shadow,
>> then edit the copies.
>>
>> When done, run 'pwck passwd.copy shadow.copy'.
>> If everything is good, replace the originals with the copies.
>
> And if the system had changed a password or made changes since you
> copied the files, you've just nuked those changes.
>
That's what change management is for. But the window of opportunity
is very small, a few seconds. On systems with hundreds/thousands
of users files are rarely used. In practice this procedure
is very safe.
-Wayne
|
|
0
|
|
|
|
Reply
|
Wayne
|
5/21/2008 6:36:10 AM
|
|
On Tue, 20 May 2008 15:40:31 -0700 (PDT), apogeusistemas@gmail.com <apogeusistemas@gmail.com> wrote:
| Hi.
|
| Is there any problem if I edit /etc/passwd file ?
|
| Which vi command (or another command) can I use to
| find hidden characters in this file ?
If all you want is to find hidden/unusual characters, try the 'od'
command. I use 'od -c' for stuff like that.
--
Reverend Paul Colquhoun, ULC. http://andor.dropbear.id.au/~paulcol
Asking for technical help in newsgroups? Read this first:
http://catb.org/~esr/faqs/smart-questions.html#intro
|
|
0
|
|
|
|
Reply
|
Paul
|
5/21/2008 6:39:04 AM
|
|
Paul Colquhoun wrote:
> On Tue, 20 May 2008 15:40:31 -0700 (PDT), apogeusistemas@gmail.com <apogeusistemas@gmail.com> wrote:
> | Hi.
> |
> | Is there any problem if I edit /etc/passwd file ?
> |
> | Which vi command (or another command) can I use to
> | find hidden characters in this file ?
>
>
> If all you want is to find hidden/unusual characters, try the 'od'
> command. I use 'od -c' for stuff like that.
>
>
I find cat -vet useful.
Pete.
|
|
0
|
|
|
|
Reply
|
Peter
|
5/21/2008 7:41:43 AM
|
|
|
10 Replies
205 Views
(page loaded in 0.399 seconds)
Similiar Articles: Minimun number of days before password change is allowed - comp ...Now is there any command( other than manually editing /etc/dafault/passwd or /etc/shadow files) to do it for specific accounts?? Thanks for your help. How do I change a user's default directory? - comp.unix.solaris ...In the previous article, Rich Teer <rich.teer@rite-group.com> wrote: > > You can edit the /etc/passwd file and modify the default home > > directory from there. Old root password - comp.sys.hp.hpuxOn 2005-06-03, Marcin 'Rambo' Roguski <m_roguski@yahoo.com> wrote: > > boot to single user mode and edit /etc/passwd by hand. > If he's already got access to a uid 0 ... passwd file problem,,,help - comp.unix.solarisHelp needed: read 3-dimensional array from a MAT-file in Fortran ... ... map" > > have you fixed those yet? This problem ... Is there any problem if I edit /etc/passwd ... passwd -> permission denied - comp.unix.solarishave you checked passwd & shadow have same nr. of lines ? # wc -l /etc/passwd /etc ... (There is however a 'vigr' command to edit /etc/group and /etc/gshadow files.) -Wayne Help on resetting root password in Cyclade for Solaris servers ...Edit /etc/passwd directly and insert a MD5 password hash (from some other host or mechanism you have) in for root and do a saveconf. Reboot and enjoy. Interrupt Boot Process on HP 382 Workstation running HP-UX 9.10 ...Edit the /etc/passwd file using vi. # vi /etc/passwd > Remove the first field of the root entry. e.g. > root::0:3::/:/bin/ksh > 6. Reboot system. e.g. # reboot Well ... How to DELETE the root password? - comp.databases.mysqlInterrupt Boot Process on HP 382 Workstation running HP-UX 9.10 ..... inherited a HP 382 workstation and need to change the root password. In ... Edit the /etc/passwd ... sunfire v210 reinstall -help please. - comp.sys.sun.admin ...This should bring >> you to a shell prompt from which you can edit /etc/passwd and >> /etc/shadow to clear the root password. Reboot and log in as root, >> set a new ... Running BASH on starting a new session - comp.sys.hp.hpux ...To get bash as your default shell you can use `chsh` command or edit /etc/passwd file and change the shell against your user-id. --vishwas. What is the best way to edit /etc/passwd, shadow, and group files?What is the best way to edit /etc/passwd, shadow, and group files? by Vivek Gite on February 27, 2006 · 4 comments · Last updated February 27, 2006 editing /etc/passwd - Database Support @ dbaspot.com - Database ...Hi. Is there any problem if I edit /etc/passwd file ? Which vi command (or another command) can I use to find hidden characters in this file ? Thanks to all. 7/25/2012 2:57:43 AM
|