Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: passwd - procedure to bypass the prompt to confirm a new passwd  (Read 7793 times)

0 Members and 1 Guest are viewing this topic.

BRIANH

    Topic Starter


    Rookie

    • Experience: Familiar
    • OS: Windows XP
    I have a  requirement to change both the root passwd and my own passwd once every 30 days. I'd like to automate the process but can't seem to find a workaround for the confirmation prompt.

    Ideally I'd like to create a script which would contain the new passwd and provide a means to send the confirmation to passwd without the prompt being sent to the screen..

    Has anyone seen / done this?  I am using Novell SUSE Linux but I'm guessing that the passwd command works the same for all flavors of Linux..

    mroilfield



      Mentor
    • Thanked: 42
      • Yes
      • Yes
    • Computer: Specs
    • Experience: Experienced
    • OS: Windows 11
    Re: passwd - procedure to bypass the prompt to confirm a new passwd
    « Reply #1 on: March 02, 2009, 08:07:11 AM »
    Why do you have a requirement to change your password every 30 days?
    You can't fix Stupid!!!

    BRIANH

      Topic Starter


      Rookie

      • Experience: Familiar
      • OS: Windows XP
      Re: passwd - procedure to bypass the prompt to confirm a new passwd
      « Reply #2 on: March 02, 2009, 08:10:28 AM »
      company policy

      Carbon Dudeoxide

      • Global Moderator

      • Mastermind
      • Thanked: 169
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Experience: Guru
      • OS: Mac OS
      Re: passwd - procedure to bypass the prompt to confirm a new passwd
      « Reply #3 on: March 02, 2009, 08:14:31 AM »
      Write a script to input the new password? Why not just give everyone your password?

      mroilfield



        Mentor
      • Thanked: 42
        • Yes
        • Yes
      • Computer: Specs
      • Experience: Experienced
      • OS: Windows 11
      Re: passwd - procedure to bypass the prompt to confirm a new passwd
      « Reply #4 on: March 02, 2009, 08:18:18 AM »
      Why not ask your company IT department for the needed script.

      Unless of course you know they will not allow you to do it. This also means that the fine people here can't help you with it either as we do not help to circumvent security policies.
      You can't fix Stupid!!!

      BRIANH

        Topic Starter


        Rookie

        • Experience: Familiar
        • OS: Windows XP
        Re: passwd - procedure to bypass the prompt to confirm a new passwd
        « Reply #5 on: March 02, 2009, 08:23:33 AM »
        I just posed a question. I'm responsible for the servers and I'm still feeling my way around in Linux. What I don't need is a lecture on procedures, allowing my passsword to be given freely to everyone or anything else.

        This forum is supposed to be a facility to pass along ideas and solutions which may be appropriate to a user; user responsiblity. Not a moral high ground or ethics 101.

        thanks for the help...

        BC_Programmer


          Mastermind
        • Typing is no substitute for thinking.
        • Thanked: 1140
          • Yes
          • Yes
          • BC-Programming.com
        • Certifications: List
        • Computer: Specs
        • Experience: Beginner
        • OS: Windows 11
        Re: passwd - procedure to bypass the prompt to confirm a new passwd
        « Reply #6 on: March 02, 2009, 11:21:52 AM »
        it's not about ethics or a moral high ground- it's about legal liability of CH and it's members and the avoidance thereof.

        IF the linux terminal/shell is not allowing you to pipe any "forced" input into passwd, it may have been designed that way.
        I was trying to dereference Null Pointers before it was cool.

        anthonyf



          Starter

          Re: passwd - procedure to bypass the prompt to confirm a new passwd
          « Reply #7 on: March 03, 2009, 10:54:21 AM »
          You should probably look into the 'expect' programming language. It can be downloaded for free for any UNIX/Linux variant and is often installed by default. It was designed for automating things that were designed to be run interactively, and the 'passwd' program certainly falls into that category. If you get 'autoexpect', it will do most of the work of writing the script for you.

          That being said, I have to agree that what you are trying to do would probably not make the admin happy.

          Dias de verano

          • Guest
          Re: passwd - procedure to bypass the prompt to confirm a new passwd
          « Reply #8 on: March 15, 2009, 02:20:39 AM »
          What I don't need is a lecture on procedures, [...] This forum is supposed to be a facility to pass along ideas and solutions which may be appropriate to a user; user responsiblity. Not a moral high ground or ethics 101.

          The remarks quoted above are like a red rag to a bull where I am concerned! BRIANH, this thread is on a web forum that anybody in the world may read. ComputerHope aims (I use the word advisedly) to be a responsible forum. Its readership includes a large number of impressionable schoolkids and novices. We don't advise how to bypass security procedures. I don't think we should advise how to deliberately sloppify them either.

          Carbon Dudeoxide

          • Global Moderator

          • Mastermind
          • Thanked: 169
            • Yes
            • Yes
            • Yes
          • Certifications: List
          • Experience: Guru
          • OS: Mac OS
          Re: passwd - procedure to bypass the prompt to confirm a new passwd
          « Reply #9 on: March 15, 2009, 02:21:50 AM »
          You mean 'Had'. Topic dates. ;)

          ghostdog74



            Specialist

            Thanked: 27
            Re: passwd - procedure to bypass the prompt to confirm a new passwd
            « Reply #10 on: March 15, 2009, 08:23:35 PM »
            I just posed a question. I'm responsible for the servers
            if you want to use passwd, hint: you can use the --stdin option. check your passwd man page.
            If you are the administrator, su to root, then execute passwd, or even usermod -p .. you shouldn't be prompted for a confirmation.

            BC_Programmer


              Mastermind
            • Typing is no substitute for thinking.
            • Thanked: 1140
              • Yes
              • Yes
              • BC-Programming.com
            • Certifications: List
            • Computer: Specs
            • Experience: Beginner
            • OS: Windows 11
            Re: passwd - procedure to bypass the prompt to confirm a new passwd
            « Reply #11 on: March 16, 2009, 09:05:25 AM »
            Ahh, there we go! there is a way to get standard input into the passwd program.
            I was trying to dereference Null Pointers before it was cool.

            banjo67xxx



              Beginner

              Thanked: 4
              • Certifications: List
              • Computer: Specs
              • Experience: Guru
              • OS: Linux variant
              Re: passwd - procedure to bypass the prompt to confirm a new passwd
              « Reply #12 on: April 11, 2009, 11:30:35 AM »
              If you only have to change your password on a single computer every 30 days then the hassle of writing a script would be more trouble than its worth, so I assume you want to change the password on many linux systems. Is that so?

              You can change the password once on one system, then get the encrypted password from /etc/shadow. Then just use sed to edit the shadow file on all the other systems from a script.

              Alternatively, configure all your linux systems to be part of a NIS domain, making one a NIS
              master and a couple of others NIS slaves, then just change your password once.

              Finally, I see there's some stuff on using LDAP with linux, so you could probably have one password for Linux and Windows like NIS, but I've never used LDAP so I might be wrong on that point.

              Dias de verano

              • Guest
              Re: passwd - procedure to bypass the prompt to confirm a new passwd
              « Reply #13 on: April 11, 2009, 11:36:35 AM »
              banjo, no point in awakening a 6 week old thread.