[scponly] Script to create jailed scp user

Paul Hyder Paul.Hyder at noaa.gov
Mon Aug 15 11:16:07 EDT 2005


Can you be more specific on what you see that indicates authentication failure?
(The error messages or output from a verbose utility execution would do.)

Would also be helpful to know what your configure options were to scponly
and which OS this is on.

In general it sounds like something in a needed library or binary is not
installed in the tree under /home/scponly/home but without additional
information it is hard to tell for sure.
     Paul Hyder
     NOAA Forecast Systems Lab
     Boulder, CO

As a quick sanity check:

Nick Anderson wrote:
> Ive been working on a script to create a user that is jailed and has scponly 
> acces and the password is randomly generated and set. Now the problem with 
> the scritp seems to be that if i use scponlyc i cant authenticate but if i 
> set the users shell to anything else say bash or just normal scponly it works 
> just fine.
> 
> 
> can anyone tell m what needs to be done with this perl script to make it work?
> there are some extra flags sent to apg atm just for a shorter password for 
> testing ... easier to type than an 8 char random passwod
> Im not approved for the list yet so please email me directly if you have any 
> suggestions nick at anders0n.net
> <script>
> #!/usr/bin/perl
> use Expect;
> 
> 
> $username=$ARGV[0];
> print "Creating $username remote backup account\n";
> 
> #generte password for user with apg
> 
> $password=`apg -n 1 -x 4 -m 4`;
> chomp($password);
> print "New Password for user is $password\n";
> 
> #create jailed user for scponl
> system("pw useradd $username -d /home/scponly//home/$username 
> -s /usr/local/bin/scponlyc -m");
> 
> $change_pass = Expect->spawn("passwd $username");
> 
> unless ($change_pass->expect(10, "Password")) {
> }
> 
> print $change_pass "$password\r";
> unless ($change_pass->expect(10, "Password")) {
> }
> print $change_pass "$password\r";
> $change_pass->soft_close();
> <script>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> scponly mailing list
> scponly at lists.ccs.neu.edu
> https://lists.ccs.neu.edu/bin/listinfo/scponly



More information about the scponly mailing list