LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-10-2006, 11:42 AM   #1
xri
Member
 
Registered: Aug 2002
Distribution: Archlinux, Garuda Linux
Posts: 283
Blog Entries: 11

Rep: Reputation: 41
Question ftp password on my script: is it insecure?


I am writing a simple script using ncftp as a client to synchronize my files with an online server. My script needs my ftp password to work.

I'm concerned about security. Is it enough to change the file permissions to make it invisible to other users? Is there a way to scramble the password to make it illegible for others? Do you recommend another ftp client (sftp)?
 
Old 12-10-2006, 11:49 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
generally i'd suggest sftp with preshared keys, but note that sftp is *NOT* an ftp client. it's an emulation of the ftp protocol over ssh, so does not use an ftp server to connect to at the other end.
 
Old 12-10-2006, 11:53 AM   #3
timdsmith
Member
 
Registered: Nov 2003
Location: The Colony, TX
Distribution: Slackware, Debian Etch, FreeBSD, MicroSh*t free.
Posts: 209

Rep: Reputation: 30
You can create a file in your home directory called .netrc
Set the permissions to 700
enter something like this...

Code:
machine  machinename

login  username

password password
Then you don't need to put the user/pass in the script.
The ftp client will look in that file. And the file will only be readable to you. Actually, the ftp client will not use it if it is not 700.
 
Old 12-10-2006, 12:06 PM   #4
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
something like sftp or scp with preshared keys would be more secure especially if you are worried about people intercepting the data. if you are just worried about people finding your password in the script then just 'chmod 700' it and to read the script they would have to have either already gained access to your user or root account or have physical access to the machine (in either case you have bigger problems anyways)
 
Old 12-10-2006, 12:30 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
also don't forget that in the wider picture of security, running one service is more secure than running two...
 
Old 12-10-2006, 05:58 PM   #6
xri
Member
 
Registered: Aug 2002
Distribution: Archlinux, Garuda Linux
Posts: 283

Original Poster
Blog Entries: 11

Rep: Reputation: 41
Smile

Thank you all for your input. You've outlined my options. I love this community.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP Password Error animelook Linux - General 5 09-07-2006 10:41 PM
ftp password error master Linux - Software 4 05-19-2005 03:59 PM
Urgent Help: Perl FTP Script Using NET::FTP xboxter Programming 8 05-16-2005 06:57 PM
FTP exposes password marghorp Linux - Security 2 02-10-2004 09:44 AM
insecure script question BajaNick Linux - Security 5 08-26-2003 10:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration