sftp is asking password


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sftp is asking password
# 15  
Old 02-25-2011
Hi
Thanks for reply.

Here is the answers of all questions in my environment

Code:
 
1. The keys should be shared between the client and the server. -- yes keys are there in both client side and server side
2. The .ssh directory should be present in the home directory of the user.--yes, directory is present.
3. The {home_dir}/.ssh/id_dsa.pub or {home_dir}/.ssh/id_rsa.pub file contains the public key. (server side) -- yes both contain public key
4. The client public key key should be placed in the {home_dir}/.ssh/authorized_keys2 file( on the server). -- the public key in the client side is placed under the file authorized_keys not in authorized_keys2 .. should i change it 
5. The .ssh directory on both client as well as server should be owned by the user and with 700 permissions. - yes the permission is 700.
6. The files inside the directory should be with 600 permissions.--yes the file permission is 600

# 16  
Old 02-25-2011
ok then could you plz tell me what permission your sftp user has. because its not like that any user can start transmitting files across servers by just creating and sharing keys. The user should have access to do sftp.
# 17  
Old 02-25-2011
iit always ask the password.
sftp won't work without password.
store that user and password into variable and then connect.
if you store in a file then expand that file store the password in a variable.
then it will work.

regards
rajesh
# 18  
Old 02-25-2011
The home directory should also be writable only by the owner:
Code:
server~ chmod 775 .  && sudo /usr/sbin/sshd -d -p 2222

client~ ssh -p 2222 server

Message on the server side:
...
debug1: trying public key file /home/userid/.ssh/authorized_keys2
Authentication refused: bad ownership or modes for directory /home/userid
...

# 19  
Old 03-01-2011
hi
everyone first of all thanks for repliesss


actually i did all those things but still it is asking password

file permission is correct , don't know why it is asking password

can you please tell me do i need to change the /etc/ssh/sshd_config file also and if yes which variable do i need to set.

please this is very important for me as i have to give this to my company this week only.
please help
# 20  
Old 03-01-2011
Quote:
Originally Posted by aishsimplesweet
Hi
Thanks for reply.

Here is the answers of all questions in my environment

Code:
 
4. The client public key key should be placed in the {home_dir}/.ssh/authorized_keys2 file( on the server). 
   -- the public key in the client side is placed under the file authorized_keys not in authorized_keys2 
   .. should i change it

I didn't notice a reply to this question. Try copying authorized_keys to authorized_keys2 and see what happens.

There always seems to be confusion as to whether you should be using one or the other of those files.

Andrew
# 21  
Old 03-01-2011
Hi

i did the same thing but still.... bad news. Smilie


any other alternative i mean if you want i can provide u the output of


Code:
 
sftp -v

mode

---------- Post updated at 07:30 AM ---------- Previous update was at 05:46 AM ----------

hi

i just exeute the sftp in the debug mode and it gives me the following debug.

Code:
debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible
Unknown code 0
)
debug1: SSH2_MSG_KEXINIT sent

what could be the problem for this,
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sftp with password

I have been tasked with scripting a sftp transfer from my clients sftp server to a vendor. I have been given a user name and password. This is an older OEL server, 5.2. I am not able to install any packages on this system. It does not have expect, ssh-pass, or any other ssh password helper... (6 Replies)
Discussion started by: mtrgoose
6 Replies

2. UNIX for Dummies Questions & Answers

SFTP without prompting password

Dear unix experts, i have a requirement as below. i need to use SFTP as FTP. ftp -n -v << ENDFTP open test_ftp.server user ftp_user_name ftp_password quit ENDFTP if i use this in a shell script, it's not asking for password. But i want the similar thing achived using... (5 Replies)
Discussion started by: AraR87
5 Replies

3. Shell Programming and Scripting

SFTP prompting for password even though password is in script

Hi All, I am trying to transfer a file from one server to a remote server using SFTP. Client is not ready for key setup. I am working on Solaris 10. Here is the code. #!/bin/ksh # sample automatic Sftp script to dump a file USER="user1" PASSWORD="pass1" HOST="host1" sftp $USER@$HOST... (6 Replies)
Discussion started by: megha2525
6 Replies

4. Shell Programming and Scripting

SFTP / SCP using password

Hi, I was provided with sftp servername, user and password and the requirement is to connect to sftp server using credentials provided and drop the file. Manually i am able to connect with commands like sftp user@servername and after clicking enter, i was asked for a password and entering... (4 Replies)
Discussion started by: forums123456
4 Replies

5. Shell Programming and Scripting

SFTP with Password

Hi Guys, I need to know how can i achieve SFTP "with" password in a shell script. I have already done passwordless key generation thing and it is working but at the moment i am interested in passing a password. And another question I have is say i have a.ksh and b.sh scripts...Can i invoke... (6 Replies)
Discussion started by: Arpit Narula
6 Replies

6. Shell Programming and Scripting

sftp password problem

Hello, trying to download data by the ksh via sftp (password protected). I am looking for the exact syntax. (I know there are 1000 of threads but I have not found anything how to add the password). ftp.XYZ.com User:ABC Passwrd:123 I tried several stuff like: sftp -b... (2 Replies)
Discussion started by: jurgen
2 Replies

7. Shell Programming and Scripting

password - SFTP

Hi team, I know if we need to transfer the files between between 2 servser, we use SFTP through key setup between 2 server. currently There are some problems and we are not able to setup keys between servers. How can i use password with SFTP for temporary solutions, so that the file... (6 Replies)
Discussion started by: Amit.Sagpariya
6 Replies

8. Shell Programming and Scripting

SFTP using user id and password

Hi, I am using below syntax - sftp -b passwordfile userid@ipaddress passwordfile is a file, in which I have just kept a password of userid. But by this, an error is coming like - Permission denied (publickey,password,keyboard-interactive). Please suggest me on this..as I dont... (6 Replies)
Discussion started by: Monalisa
6 Replies

9. Red Hat

sftp/scp without password

Hi, I want to use sftp/scp without password.How can I do that ?? I plan to use script with scp/sftp and execute by cronjob ,any sample or example?? How can I test the scp/sftp working or not in the same user account , in the same red linux server?? any suggestion ??? (5 Replies)
Discussion started by: chuikingman
5 Replies

10. Shell Programming and Scripting

SFTP password automation

I am working on a script to automate and SFTP that I am currently doing to a company that does not allow for a .ssh profile to be created. I have search and read about the -b option and am wondering if i can get some more information about it. I tried to right a file containing the password... (3 Replies)
Discussion started by: jaycheetwood
3 Replies
Login or Register to Ask a Question