Professional Web Applications Themes

Carrying forward user info from SCO to Linux - SCO

I have a SCO Openserver system V system. I have recently installed another server with LINUX 9 on it. Is there any method to convert the user information from the SCO system to Linux system to avoid creating all the users again on the new system? regards Venu...

  1. #1

    Default Carrying forward user info from SCO to Linux

    I have a SCO Openserver system V system. I have recently installed
    another server with LINUX 9 on it. Is there any method to convert the
    user information from the SCO system to Linux system to avoid creating
    all the users again on the new system?

    regards
    Venu
    P.Venugopal Guest

  2. #2

    Default Re: Carrying forward user info from SCO to Linux

    P.Venugopal <com> wrote: 


    Sure:

    From http://aplawrence.com/SCOFAQ/scotec1.html#ilinuxpass

    If the SCO passwd file has the encrypted password in its second field (in other words, the system isn't using /etc/shadow), then this simple script will work:

    IFS=":"
    cat scopasswdfile | while read line
    do
    set $line
    useradd -c $5 -p $2 -s /bin/bash -d /home/$1 -m $1
    done


    This requires a current version of "useradd"; the older versions don't take encrypted passwords with -p

    Normally, however, the encrypted passwords will be in /etc/shadow. This needs a little more work:

    sort scopasswd > /tmp/p1
    sort scoshadow > /tmp/p2
    join -t: /tmp/p1 /tmp/p2 > /tmp/pscopass
    IFS=":"
    cat /tmp/pscopass | while read line
    do
    set $line
    useradd -c $5 -p $8 -s /bin/bash -d /home/$1 -m $1
    done


    Note that only the first 13 characters in the non-shadow passwd file are the encrypted password; the rest (stuff after the comma) is for password aging: see "man F passwd".


    --
    com Unix/Linux/Mac OS X resources: http://aplawrence.com
    Get paid for writing about tech: http://aplawrence.com/publish.html
    tony@aplawrence.com Guest

  3. #3

    Default Re: Carrying forward user info from SCO to Linux

    Tony Lawrence typed (on Mon, Oct 06, 2003 at 12:00:35PM +0000):
    | P.Venugopal <com> wrote:
    | >I have a SCO Openserver system V system. I have recently installed
    | >another server with LINUX 9 on it. Is there any method to convert the
    | >user information from the SCO system to Linux system to avoid creating
    | >all the users again on the new system?
    |
    |
    | Sure:
    |
    | >From http://aplawrence.com/SCOFAQ/scotec1.html#ilinuxpass
    |
    | If the SCO passwd file has the encrypted password in its second field (in other words, the system isn't using /etc/shadow), then this simple script will work:
    |
    | IFS=":"
    | cat scopasswdfile | while read line
    | do
    | set $line
    | useradd -c $5 -p $2 -s /bin/bash -d /home/$1 -m $1
    | done
    |
    |
    | This requires a current version of "useradd"; the older versions don't take encrypted passwords with -p
    |
    | Normally, however, the encrypted passwords will be in /etc/shadow. This needs a little more work:
    |
    | sort scopasswd > /tmp/p1
    | sort scoshadow > /tmp/p2
    | join -t: /tmp/p1 /tmp/p2 > /tmp/pscopass
    | IFS=":"
    | cat /tmp/pscopass | while read line
    | do
    | set $line
    | useradd -c $5 -p $8 -s /bin/bash -d /home/$1 -m $1
    | done
    |
    |
    | Note that only the first 13 characters in the non-shadow passwd file are the encrypted password; the rest (stuff after the comma) is for password aging: see "man F passwd".
    |

    Wouldn't it be easier to ditch the shadow file and recosntruct it, by
    running pwunconv, grabbing a copy of /etc/passwd, then running pwconv?

    Aside: Tony, you're posting >80-char lines??


    --
    JP
    Jean-Pierre Guest

  4. #4

    Default Re: Carrying forward user info from SCO to Linux

    Jean-Pierre Radley <com> wrote: 
     

    Probably so; I've added that to that FAQ.
     

    Yes, sorry: noticed right after I hit post.. :-(

    --
    com Unix/Linux/Mac OS X resources: http://aplawrence.com
    Get paid for writing about tech: http://aplawrence.com/publish.html
    tony@aplawrence.com Guest

  5. #5

    Default Re: Carrying forward user info from SCO to Linux

    Your solution worked fine.Only users without password which is allowed
    in SCO got rejected in Linux eventhough I had changed default min.
    lenght to 0 .Also I removed the entries of root,adm,bin,lp etc. before
    running your script.Would it have caused problems, if not removed?

    Venu

    com wrote in message news:<blrlh3$6qp$std.com>... 
    >
    >
    > Sure:
    >
    > From http://aplawrence.com/SCOFAQ/scotec1.html#ilinuxpass
    >
    > If the SCO passwd file has the encrypted password in its second field (in other words, the system isn't using /etc/shadow), then this simple script will work:
    >
    > IFS=":"
    > cat scopasswdfile | while read line
    > do
    > set $line
    > useradd -c $5 -p $2 -s /bin/bash -d /home/$1 -m $1
    > done
    >
    >
    > This requires a current version of "useradd"; the older versions don't take encrypted passwords with -p
    >
    > Normally, however, the encrypted passwords will be in /etc/shadow. This needs a little more work:
    >
    > sort scopasswd > /tmp/p1
    > sort scoshadow > /tmp/p2
    > join -t: /tmp/p1 /tmp/p2 > /tmp/pscopass
    > IFS=":"
    > cat /tmp/pscopass | while read line
    > do
    > set $line
    > useradd -c $5 -p $8 -s /bin/bash -d /home/$1 -m $1
    > done
    >
    >
    > Note that only the first 13 characters in the non-shadow passwd file are the encrypted password; the rest (stuff after the comma) is for password aging: see "man F passwd".
    >
    >
    > --
    > com Unix/Linux/Mac OS X resources: http://aplawrence.com
    > Get paid for writing about tech: http://aplawrence.com/publish.html[/ref]
    P.Venugopal Guest

Similar Threads

  1. php and linux user account
    By MAD in forum PHP Development
    Replies: 0
    Last Post: November 27th, 12:33 AM
  2. Php script - create mail user - Linux/Postfix
    By Jean-Louis Vill in forum PHP Development
    Replies: 1
    Last Post: August 27th, 03:32 AM
  3. [gmane.linux.debian.user] PowerManagement mysteries
    By Alban Browaeys in forum Debian
    Replies: 0
    Last Post: August 1st, 06:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139