LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-25-2011, 12:04 PM   #1
MarcosPauloBR
Member
 
Registered: Feb 2011
Location: Santa Catarina - Brazil
Distribution: Slackware
Posts: 129

Rep: Reputation: 3
Question SFTP connection with user and passwd on the header


Hi people!

Anybody knows how I can do a ftp connection putting the user and passwd as default?

Thanks for your time!
 
Old 03-25-2011, 12:44 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Can I ask why you would want to do this in the first place?
 
Old 03-25-2011, 12:58 PM   #3
MarcosPauloBR
Member
 
Registered: Feb 2011
Location: Santa Catarina - Brazil
Distribution: Slackware
Posts: 129

Original Poster
Rep: Reputation: 3
I need to make a SFTP connection to transfer a couple files in two servers, but I need this on a not interactive shell, I need to set the USER and PASSWD on the connection.

Its will run on cron...

Do you know how can I do this??

Thanks!

Last edited by MarcosPauloBR; 03-25-2011 at 01:07 PM.
 
Old 03-25-2011, 01:34 PM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
http://linux.die.net/man/1/ftp
http://linux.die.net/man/5/netrc

You can use netrc for an auto login if necessary.

Cheers,

Josh
 
Old 03-25-2011, 01:52 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,678

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
With sftp the best method is to setup a ssh public/private key pair.

Lots of information on the web but here is a link to get you started.
https://hkn.eecs.berkeley.edu/~dhsu/...key_howto.html
 
Old 03-25-2011, 01:52 PM   #6
MarcosPauloBR
Member
 
Registered: Feb 2011
Location: Santa Catarina - Brazil
Distribution: Slackware
Posts: 129

Original Poster
Rep: Reputation: 3
Thanks!

I've talked with the IT of the company, and they tell me there we need the generate a key to make this connection!

Thanks!
 
Old 03-27-2011, 08:03 PM   #7
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
You can do it yourself w/ normal user privileges, follow the instructions in michaelk's link.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] SFTP with user nectand passwd set on the header of connection MarcosPauloBR Linux - Newbie 1 03-25-2011 01:55 PM
user can't change user account passwd rcmonroig Linux - Newbie 3 11-09-2009 09:44 PM
[SOLVED] sftp, connection closed after successful connection. kaz2100 Linux - Software 1 09-30-2009 10:32 PM
how to create sftp user only in red hat 4 not ftp user ..only sftp user princeu28 Linux - Newbie 1 10-14-2008 08:10 AM
User Creationg : ssh/sftp user jail to $HOME only routers Solaris / OpenSolaris 2 10-29-2007 11:28 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:56 PM.

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