<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script help in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685536#M20879</link>
    <description>The following modification of the above script will add 10 users, user1, user2, etc. and set the password for each the same as the username.&lt;BR /&gt;&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;for i in `seq 1 10`&lt;BR /&gt;do&lt;BR /&gt;useradd -m -p user${i} user${i} &lt;BR /&gt;done&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;The -p option sets the encrypted password.&lt;BR /&gt;&lt;BR /&gt;JL</description>
    <pubDate>Wed, 07 Dec 2005 09:36:42 GMT</pubDate>
    <dc:creator>Jess Long</dc:creator>
    <dc:date>2005-12-07T09:36:42Z</dc:date>
    <item>
      <title>Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685522#M20865</link>
      <description>Hi all,&lt;BR /&gt;     I want to write a shell script to automate the useradd and assigning password to that user [ only through shell script ]. I  tried with using "EOF" but still the script prompts for passowrd.&lt;BR /&gt;&lt;BR /&gt;The script that I wrote was&lt;BR /&gt;!/usr/bin/sh -x&lt;BR /&gt;useradd prasad&lt;BR /&gt;echo "vnc" 2&amp;gt;&amp;amp;1&lt;BR /&gt;# Here prasad is username and test is password.&lt;BR /&gt;passwd prasad &amp;lt;&amp;lt; EOF&lt;BR /&gt;test&lt;BR /&gt;test&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Can anyone help me to automate this......&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Prabu.S&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Dec 2005 07:03:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685522#M20865</guid>
      <dc:creator>Senthil Prabu.S_1</dc:creator>
      <dc:date>2005-12-06T07:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685523#M20866</link>
      <description>And also I dont want to do this using expect.&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Dec 2005 07:07:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685523#M20866</guid>
      <dc:creator>Senthil Prabu.S_1</dc:creator>
      <dc:date>2005-12-06T07:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685524#M20867</link>
      <description>here's an example&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;for i in `seq 1 10`&lt;BR /&gt;do useradd user$i&lt;BR /&gt;echo password$i |passwd --stdin user$i&lt;BR /&gt;done&lt;BR /&gt;exit&lt;BR /&gt;it adds 10 users user1, user2,etc&lt;BR /&gt;and gives each the password same as username.</description>
      <pubDate>Tue, 06 Dec 2005 08:07:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685524#M20867</guid>
      <dc:creator>Alexander Chuzhoy</dc:creator>
      <dc:date>2005-12-06T08:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685525#M20868</link>
      <description>No, the script fails&lt;BR /&gt;&lt;BR /&gt;The error is &lt;BR /&gt;Try `passwd --help' or `passwd --usage' for more information.&lt;BR /&gt;passwd: unrecognized option `--stdin'&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Dec 2005 08:41:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685525#M20868</guid>
      <dc:creator>Senthil Prabu.S_1</dc:creator>
      <dc:date>2005-12-06T08:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685526#M20869</link>
      <description>what operating system do you use?</description>
      <pubDate>Tue, 06 Dec 2005 08:50:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685526#M20869</guid>
      <dc:creator>Alexander Chuzhoy</dc:creator>
      <dc:date>2005-12-06T08:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685527#M20870</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;cat /etc/SuSE-release&lt;BR /&gt;SUSE LINUX Enterprise Server 9 (i586)&lt;BR /&gt;VERSION = 9&lt;BR /&gt;PATCHLEVEL = 2&lt;BR /&gt;&lt;BR /&gt;Any inputs......</description>
      <pubDate>Tue, 06 Dec 2005 08:54:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685527#M20870</guid>
      <dc:creator>Senthil Prabu.S_1</dc:creator>
      <dc:date>2005-12-06T08:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685528#M20871</link>
      <description>Hi alex,&lt;BR /&gt;   I googled but no use.&lt;BR /&gt;My passwd utility doesnot support --stdin option.&lt;BR /&gt;&lt;BR /&gt;Is this possible to do in a shell script?</description>
      <pubDate>Tue, 06 Dec 2005 09:42:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685528#M20871</guid>
      <dc:creator>Senthil Prabu.S_1</dc:creator>
      <dc:date>2005-12-06T09:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685529#M20872</link>
      <description>You can use the -p key for useradd command&lt;BR /&gt;try:&lt;BR /&gt;useradd test -p password for example.&lt;BR /&gt;Where password is the crypted password.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Dec 2005 10:52:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685529#M20872</guid>
      <dc:creator>Alexander Chuzhoy</dc:creator>
      <dc:date>2005-12-06T10:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685530#M20873</link>
      <description>Hi Alex,&lt;BR /&gt;       My problem is that I wanted to create a user account and also assign password to that user, to be done in a shell script. Any another script uses this user to do some operations.&lt;BR /&gt;&lt;BR /&gt;So, useradd -p will never going to help me.</description>
      <pubDate>Tue, 06 Dec 2005 23:53:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685530#M20873</guid>
      <dc:creator>Senthil Prabu.S_1</dc:creator>
      <dc:date>2005-12-06T23:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685531#M20874</link>
      <description>;) hi how r u.&lt;BR /&gt;&lt;BR /&gt;You can not achive this with back scripting with EOF format as like ftp. &lt;BR /&gt;&lt;BR /&gt;Few ways to accomplish as,&lt;BR /&gt;&lt;BR /&gt; 1) expect scripting to accomplish job&lt;BR /&gt; 2) telnet piping script as,&lt;BR /&gt;&lt;BR /&gt;    (&lt;BR /&gt;     sleep 1&lt;BR /&gt;     echo "root"&lt;BR /&gt;     sleep 1&lt;BR /&gt;     echo "&lt;ROOT passwd=""&gt;"&lt;BR /&gt;     sleep 1&lt;BR /&gt;     echo "passwd &lt;ACCOUNT name=""&gt;"&lt;BR /&gt;     sleep 1&lt;BR /&gt;     echo "password"&lt;BR /&gt;     sleep 1&lt;BR /&gt;     echo "password"&lt;BR /&gt;     sleep 1&lt;BR /&gt;     echo "exit"&lt;BR /&gt;   ) | telnet localhost&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Change the sleep timings based on your system speed. Revert back if this is not working.&lt;BR /&gt;&lt;BR /&gt;-Muthu&lt;/ACCOUNT&gt;&lt;/ROOT&gt;</description>
      <pubDate>Wed, 07 Dec 2005 01:31:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685531#M20874</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-12-07T01:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685532#M20875</link>
      <description>Hi,&lt;BR /&gt;   :-), nice to hear from you.I modified ur script as below;&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;useradd test&lt;BR /&gt;(&lt;BR /&gt;sleep 1&lt;BR /&gt;echo "test"&lt;BR /&gt;sleep 1&lt;BR /&gt;echo "test"&lt;BR /&gt;sleep 1&lt;BR /&gt;echo "passwd test"&lt;BR /&gt;sleep 1&lt;BR /&gt;echo "test"&lt;BR /&gt;sleep 1&lt;BR /&gt;echo "test"&lt;BR /&gt;sleep 1&lt;BR /&gt;echo "exit"&lt;BR /&gt;) | telnet localhost&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;When I execute it,&lt;BR /&gt;kassel1:/home/rtp40/prabu # ./2.sh&lt;BR /&gt;Trying 127.0.0.1...&lt;BR /&gt;telnet: connect to address 127.0.0.1: Connection refused&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;entry in /etc/passwd&lt;BR /&gt;test:x:5002:100::/home/test:/bin/bash&lt;BR /&gt;&lt;BR /&gt;entry in /etc/shadow&lt;BR /&gt;test:x:5002:100::/home/test:/bin/bash&lt;BR /&gt;&lt;BR /&gt;Can you throw some more lights on this......</description>
      <pubDate>Wed, 07 Dec 2005 03:57:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685532#M20875</guid>
      <dc:creator>Senthil Prabu.S_1</dc:creator>
      <dc:date>2005-12-07T03:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685533#M20876</link>
      <description>change localhost to your machine name or machine ip-address itself. Just try to connect with the machine where you want to change password of the user account with telnet. It may be localhost or 127.0.0.1 or hostname or ip-address or FQDN.&lt;BR /&gt;&lt;BR /&gt;-Muthu</description>
      <pubDate>Wed, 07 Dec 2005 04:21:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685533#M20876</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-12-07T04:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685534#M20877</link>
      <description>I tried on another machine.&lt;BR /&gt;&lt;BR /&gt;Output:&lt;BR /&gt;bash-3.00# ./2.sh&lt;BR /&gt;+ useradd test&lt;BR /&gt;+ sleep 1&lt;BR /&gt;+ telnet localhost&lt;BR /&gt;Trying ::1...&lt;BR /&gt;Connected to localhost.&lt;BR /&gt;Escape character is '^]'.&lt;BR /&gt;+ echo test&lt;BR /&gt;+ sleep 1&lt;BR /&gt;+ echo test&lt;BR /&gt;+ sleep 1&lt;BR /&gt;login: Password: + echo 'passwd test'&lt;BR /&gt;+ sleep 1&lt;BR /&gt;&lt;BR /&gt;+ echo test1&lt;BR /&gt;test1&lt;BR /&gt;+ sleep 1&lt;BR /&gt;+ echo test1&lt;BR /&gt;test1&lt;BR /&gt;+ sleep 1&lt;BR /&gt;+ echo exit&lt;BR /&gt;exit&lt;BR /&gt;Connection to localhost closed by foreign host.&lt;BR /&gt;bash-3.00#&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But I couldnot login as test using passeord, &lt;BR /&gt;"test1". It fails.</description>
      <pubDate>Wed, 07 Dec 2005 04:36:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685534#M20877</guid>
      <dc:creator>Senthil Prabu.S_1</dc:creator>
      <dc:date>2005-12-07T04:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685535#M20878</link>
      <description>It is the problem sleep statements. You have to vary the sleep timings based on your machine. I hope your machine is *dead* slow to get login prompt. Change first sleep before echo "account name" as sleep 3 and try. Vary sleep timings upto the passwd command is getting worked.&lt;BR /&gt;&lt;BR /&gt;-Muthu</description>
      <pubDate>Wed, 07 Dec 2005 04:40:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685535#M20878</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-12-07T04:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685536#M20879</link>
      <description>The following modification of the above script will add 10 users, user1, user2, etc. and set the password for each the same as the username.&lt;BR /&gt;&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;for i in `seq 1 10`&lt;BR /&gt;do&lt;BR /&gt;useradd -m -p user${i} user${i} &lt;BR /&gt;done&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;The -p option sets the encrypted password.&lt;BR /&gt;&lt;BR /&gt;JL</description>
      <pubDate>Wed, 07 Dec 2005 09:36:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685536#M20879</guid>
      <dc:creator>Jess Long</dc:creator>
      <dc:date>2005-12-07T09:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685537#M20880</link>
      <description>The CD that comes with Nemeth et al's Unix System Administration Handbook has exactly the utility you want.  You should be able to download a current image of the CD from the publisher's web site.</description>
      <pubDate>Wed, 07 Dec 2005 12:37:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help/m-p/3685537#M20880</guid>
      <dc:creator>Alan_152</dc:creator>
      <dc:date>2005-12-07T12:37:00Z</dc:date>
    </item>
  </channel>
</rss>

