0

Is it possible to create a new user on Linux, in way that I will not use password that asked from scp ???

For example

    scp my_new_login@100.119.100.11:/home/dir/file . (scp not ask about password) 

The target is to copy /home/dir/file to current directory without password, by changing login and password configuration/setup

I create the login/password by this script:

 more user.sh 
 #!/bin/sh
 UNAME=my_new_login
 UPASS=MY_PASS
 wall "$UNAME $UPASS"
 useradd "$UNAME"
 echo "$UPASS" | passwd "$UNAME" --stdin
 usermod -g restricted "$UNAME"
Diana
  • 261

1 Answers1

1

With SSH, you have two options to avoid typing a password when prompted:

  1. Key-based authentication
  2. Something like an expect script to type in the username/password when prompted automatically.

I highly recommend the first option over the second one.

JakePaulus
  • 2,367