How to setup a password less ftp??


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to setup a password less ftp??
# 1  
Old 07-08-2013
How to setup a password less ftp??

hi,

i want to setup a password less FTP to a remote server so that i can ftp to a remote server without the password.
i have setup a passwordless ssh and i am able to use scp commands to connect to the remote server without asking for the password. but when i try to ftp to the same remote server, it still asks for the password. is it possible to set up a passwordless ftp also?
# 2  
Old 07-08-2013
Yes use 'sftp', this is an example:
Code:
#!/usr/bin/ksh
# test_sftp.sh
sftp -b /dev/stdin -v -o BatchMode=yes -o IdentityFile=/export/home/user/.ssh/id_rsa -o Port=22 user@host <<ENDSFTP
cd /home/user/test
put /export/home/user/test/test.txt test.txt.xferring
rename test.txt.xferring test.txt
quit
ENDSFTP
rc=$?
if [[ $rc != 0 ]]    then
    print "Error occured...$rc" `date "+%Y-%m-%d-%H.%M.%S"`
else
 print "Successful transfer...$rc" `date "+%Y-%m-%d-%H.%M.%S"`
fi

# 3  
Old 07-08-2013
Quote:
Originally Posted by Little
but when i try to ftp to the same remote server, it still asks for the password. is it possible to set up a passwordless ftp also?
FTP and ssh are wholly different.

ssh includes the sftp protocol though, which is enough like ftp to perhaps solve the same problem for you, and logs in the exact same way as ssh -- it should use the exact same keys.
# 4  
Old 07-08-2013
Quote:
Originally Posted by Corona688
FTP and ssh are wholly different.

ssh includes the sftp protocol though, which is enough like ftp to perhaps solve the same problem for you, and logs in the exact same way as ssh -- it should use the exact same keys.
i have created a .netrc file in my home directory for ftp to work without prompting for password. Is it ok and safe?
# 5  
Old 07-09-2013
Its ok to use but not completely safe. Super users and specific sudo users can read this file even if you protect it with permissions.
# 6  
Old 07-09-2013
so is there any other solution? i think its not possible to create rsa private and public keys and copy the public key in remote servers authenticated_keys file. this works only for sftp that uses ssh. FTP still prompts for password. any other way?
# 7  
Old 07-09-2013
I dont think you have many options than .netrc for simple ftp.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

SSH password less setup asking for password

Hello Experts, when I am trying to connect my target server through sftp after creating ssh password less setup, it is asking for passowrd to connect. to setup this I followed below process: -->generated keys by executing the command "ssh-keygen -t rsa" -->this created my .ssh directory... (9 Replies)
Discussion started by: Devipriya Ch
9 Replies

2. UNIX for Advanced & Expert Users

Setup Samba Server to always ask user and password

How do I setup a Samba server to always ask to user and password, when a windows user, prints your files using a shared printer through a Samba Linux Server (CUPS)? (0 Replies)
Discussion started by: viga
0 Replies

3. Solaris

How can i setup ssh password-less login for particular user?

HI Community. I was trying to create ssh password less authentication for one user called night and it's not working for me. These are the steps I followed:- I have logged into the server and issued ssh-ketgen -t rsabash-3.2$ ssh-keygen -t rsa Generating public/private rsa key pair.... (4 Replies)
Discussion started by: bentech4u
4 Replies

4. UNIX for Dummies Questions & Answers

To setup chrooting ftp

Hi Guru's , Can some one explain me what is chrooting ftp and how to setup the same in Solaris 10 Local zone (Sparse). Thanks In Advance. (1 Reply)
Discussion started by: rama krishna
1 Replies

5. Red Hat

setup sudo for cmd exec w/o password

i need to set up a user to execute a restricted command as another user and to be able to do so without entering a password. I understand the security concerns but let's not go there, unless you are really compelled to do so... The directive to permit is that I believe should work and did add to... (2 Replies)
Discussion started by: twk
2 Replies

6. UNIX for Advanced & Expert Users

ftp server setup help

Hello all, Am in the process of setting up ftp server in my RHEL3 box. Here is where I downloaded the vsftp server ftp://scary.beasts.org/users/cevans/vsftpd-2.1.1pre1.tar.gz ftp server daemon is running fine, accepting connections from client but the issue is that 'user' I specifically... (3 Replies)
Discussion started by: matrixmadhan
3 Replies

7. UNIX for Advanced & Expert Users

Setup Secure FTP

Hi All, Please help me to setup the secure Ftp. I want to build a ftp which should ask the Login id and password, and one thing more a particular login should be enable to read/write only his/her directory i.e,s a user should not be able to open the other directories in the ftp.Please help me... (1 Reply)
Discussion started by: akhtar.bhat
1 Replies

8. HP-UX

How To Setup Ftp Server

Hi, I'm planning to setup ftp server but I dont have yet what platform i'll be using. I think what ever flavor it is it will go in the same approach right, anyway I just would like to ask how to setup ftp in unix I know too many of here alraedy done with it. Thanks in advance. (0 Replies)
Discussion started by: eykyn17
0 Replies

9. IP Networking

UNIX FTP setup

I just had to rebuild my Sun Ultra 2 running Solaris 2.5.1 as the boot drive failed. Now I can't log on from the Windows XP using WS_FTP Pro, and can't see the PC on the sun using ftp (it just hangs). I think I need to add IP addresses to the host file on the Sun box, but can't find information... (4 Replies)
Discussion started by: pilgrim4119
4 Replies

10. UNIX for Dummies Questions & Answers

How to setup an FTP server?

i want setup an ftp server on my homelab now i downloaded resource management book from sun there it shows you how to make the entry in the inet.d.conf file also how to control ftp access but how do u actually set it up? say like i want certain file to be obtain through ftp how do i do that? oh... (1 Reply)
Discussion started by: rmuhammad
1 Replies
Login or Register to Ask a Question