Re: Shell Script on Debian

2008-06-28 Thread Daniel Kahn Gillmor
On Fri 2008-06-27 09:39:24 -0400, Lennart Sorensen wrote: > The environment could be viewed too. How can the environment be viewed, other than by the same user? On a lenny/sid system, it looks to me like the environment is only visible to the process owner: [0 [EMAIL PROTECTED] ~]$ ls -la /pr

Re: Shell Script on Debian

2008-06-27 Thread Lennart Sorensen
On Fri, Jun 27, 2008 at 11:42:53AM +0200, Lo?c Minier wrote: > (Not quite sure how this relates to arm.) > > On Fri, Jun 27, 2008, ApOgEE wrote: > > set password [lindex \$argv 1] > > The command line might be visible by all users of the system, unless > you use some locked down kernel, so I w

Re: Shell Script on Debian

2008-06-27 Thread ApOgEE
Hi all, Thanks for all comments, that code may not good for security reason. Hope you can suggest the more secure and proper way to do so. Since the purpose of creating that script as for me is to be able to use script to change the password from other interface for example from a PHP web interfac

Re: Shell Script on Debian

2008-06-27 Thread Loïc Minier
(Not quite sure how this relates to arm.) On Fri, Jun 27, 2008, ApOgEE wrote: > set password [lindex \$argv 1] The command line might be visible by all users of the system, unless you use some locked down kernel, so I wouldn't pass the password on the command line. -- Loïc Minier -- To U

Re: Shell Script on Debian

2008-06-27 Thread Mike Pellatt
I presume everyone is aware of the risks associated with storing plaintext passwords in any file, including script files, and the ways of reducing (but not eliminating) said risks. For example (but by no means exhaustively) I wouldn't do chmod +x on the file, but would do chmod u+x. and al

Re: Shell Script on Debian

2008-06-27 Thread ApOgEE
Owh, another thing... make sure you've installed 'expect' # apt-get install expect Good Luck!! On Fri, Jun 27, 2008 at 4:50 PM, ApOgEE <[EMAIL PROTECTED]> wrote: > Hi, > There is another way... Here's my way to do it: > copy and paste this command: > > $ cat > chpass << EOF > #!/bin/sh > # \\ >

Re: Shell Script on Debian

2008-06-27 Thread ApOgEE
Hi, There is another way... Here's my way to do it: copy and paste this command: $ cat > chpass << EOF #!/bin/sh # \\ exec expect -f "\$0" \${1+"\$@"} set password [lindex \$argv 1] spawn passwd [lindex \$argv 0] sleep 1 expect "assword:" send "\$password\r" expect "assword:" send "\$password\r" e

Re: Shell Script on Debian

2008-06-26 Thread David Weinehall
On Fri, Jun 27, 2008 at 11:45:45AM +0700, Phuong Phan Thi Bach wrote: > Hello, > The "passwd" command expects to read the new password only from the > console, How to it read the new password only from a file. I create a file > (Ex: test file ) > > test file > 123456 > 123456 > After, I use: "*p

Shell Script on Debian

2008-06-26 Thread Phuong Phan Thi Bach
Hello, The "passwd" command expects to read the new password only from the console, How to it read the new password only from a file. I create a file (Ex: test file ) test file 123456 123456 After, I use: "*passwd < test*" (shell on Debian is sh) But it always error: "Enter new UNIX password: Re