Operating System - HP-UX
1825020 Members
3057 Online
109678 Solutions
New Discussion юеВ

FTP without asking for password

 
SOLVED
Go to solution
Sarvesh A Dhuri
Advisor

FTP without asking for password

Hi

My network security administrator do not allow rcp , is there any way to use FTP between the two unix server (HP UX 11i) without prompting for a password.

Thanks in advance
I have been betrayed by our own People
10 REPLIES 10
Steven E. Protter
Exalted Contributor

Re: FTP without asking for password

I do not belive so.

You can use secure shell however. It has a function like rcp called scp. Except its secure.

http://software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA

Then exchange public keys and you are done.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
H.Merijn Brand (procura
Honored Contributor
Solution

Re: FTP without asking for password

Add in your ~/.netrc (mode 600)

machine blah login user password secret

or fiddle with /etc/hosts.equiv, ~user/.rhosts

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Dino_4
Frequent Advisor

Re: FTP without asking for password


Hi,

u can create a .netrc in your $HOME.

Check 'man .netrc'
Marvin Strong
Honored Contributor

Re: FTP without asking for password

should be able to do it with .netrc as others have stated. Put it in your home directory.

man netrc
Abdul Rahiman
Esteemed Contributor

Re: FTP without asking for password

Hi,

In these type of situations, I would vote for using Secure shell. It has utilities to replace rsh, rcp, telnet, ftp etc. in secure (read encrypted) way.

Setup SSh to use key based authentication so that there is no clear text passwrod going across the netowrk which would make your systems very vulnerable to network sniffing attacks.

regds,
Abdul.
No unix, no fun
Steven E. Protter
Exalted Contributor

Re: FTP without asking for password

Forgot about that .ntrc file.

The reason that methodology never comes to mind is that its a security problem.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Muthukumar_5
Honored Contributor

Re: FTP without asking for password

Hai,

You can use the $HOME/.netrc file to do this.Create the file on home directory as

#-------- .netrc ---------
machine login password

Create the file to allow the users in both servers.

You can do with scripting too as like
# script
machine=$1
file=$2

if [[ $# -ne 2 ]]; then
echo " Usage: "
exit 1
fi

ftp -i -n machine <<-EOF 2>/dev/null
!ksh $file
EOF

Use the script on both side. You can use the commands lists in a file as,
#cat /tmp/ftpcmd.ksh
user username password
pwd
ls
cd /dir1/dir2
bye

You can add this script to /usr/bin/ to be used for ever in all machines.

Regards,
Muthukumar.

Easy to suggest when don't know about the problem!
Sandeep Geet
Occasional Contributor

Re: FTP without asking for password

Hi !

You can try this script, I have tested this successfully,

ftp -i -n -v "Serevr Address: << EOF
user "user name" "password"
put "file name"
bye
EOF

Best of Luck
Sandeep
Sandeep Geet
Occasional Contributor

Re: FTP without asking for password

Hi !

You can try this script, I have tested this successfully,

ftp -i -n -v "Server Address: << EOF
user "user name" "password"
put "file name"
bye
EOF

Best of Luck
Sandeep
Christian Tremblay
Trusted Contributor

Re: FTP without asking for password

I your sysadmin prohibits using rcp for security reasons, he certainly is not going to allow .netrc files or ftp scripts that will xmit clear passwords over tne network.

Use secure shell for logins and scp for transfers.