I have a problem with SFTP, the problem that asks me for the password and the shell stops, what I need is not to ask me for the password to take it from the variety I am giving
sftp ftpsic@$NodoFtpOms <<END_SCRIPT
quote PASS $PassFtpOms
cd $RutaFtpOms
pwd
put $NomArch
pwd
ls
quit
END_SCRIPT
what happens that inside a shell I have an FTP connection when it reaches the part of the key the shell asks me for the key and the shell is paused I need it to happen without asking for the key
The problem I have is that when I run the shell, after connecting to the sftp it asks me for the password and is waiting for the password and I need it to be taken from the Variable
sftp ftpsic@$NodoFtpOms <<END_SCRIPT
quote PASS $PassFtp
pwd
put $NomArch
pwd
ls
quit
END_SCRIPT
So, can you show us the output that you are getting? I'm wondering if you are being prompted for the SSH key passphrase as opposed to the remote user password.
A simple test would be something like:-
sftp ftpsic@$NodoFtpOms <<END_SCRIPT
dir
END_SCRIPT
If this doesn't work, then perhaps we can look at the process of creating and sharing keys for a password-less connection. The client that opens the connection should create the SSH key pair. The public key from the client needs to be copied to the server you are connecting to. The file permissions need to be suitably tight. If you open the files up to more access, then the ssh/sftp client and/or the sshd will reject them. Doing a chmod 666 ..... will break it.
Can you show us the output of ls -l ~/.ssh on the client as the executing user and on the server side as the targeted user? Do not share the content of the private keys on-line.