LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-05-2011, 11:04 AM   #1
yourlovenotenough
LQ Newbie
 
Registered: Aug 2011
Distribution: debbi
Posts: 3

Rep: Reputation: Disabled
SFTP and SSH session password


I have a small bash script to SFTP files to a remote box. Then script continues and I SSH to the box to process the uploaded files, etc.

My problem with this I have to enter the password twice and ideally I'd like to do everything in one session.

Do you have any idea if this can be done in one run?

I cannot access the local machine from the remote machine, e.g. I cannot
1) SSH to remote
2) then pull the files via SFTP from the local from the remote machine.

Maybe some session saver to store the password? If so, how can I do/invoke it from a command-line script? I use XFCE 4.6.2.

I know the SSH key generation, but I'd leave it as last solution.

thx.
 
Old 08-05-2011, 11:07 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Quote:
I know the SSH key generation, but I'd leave it as last solution
.. why? that's the easiest solution - try 'ssh-copy-id'
 
Old 08-05-2011, 12:40 PM   #3
yourlovenotenough
LQ Newbie
 
Registered: Aug 2011
Distribution: debbi
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by kbp View Post
.. why? that's the easiest solution - try 'ssh-copy-id'
Thanks for the response, the problem is this is not an 'ordinary' Linux box but a router with OpenWRT.

The problem is Catch 22.

The first problem was that the remote box didn't respond:
debug1: Offering public key: /home/myuser/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply

I set up a temporary other SSH channel and figured out the problem:
[2841] Aug 05 19:26:18 /tmp must be owned by user or root, and not writable by others

Okay so I set 700 on /tmp, then the PKI auth works as a charm - but as my standard user don't have the access to the homedir thus cannot login
[2860] Aug 05 17:30:02 exit after auth (myuser): error changing directory

The /home directory is /tmp on the box for both root and other standard users.

I can hack around to move my user to an another location - but well then the current password login looks still less troublesome.
 
Old 08-05-2011, 12:56 PM   #4
yourlovenotenough
LQ Newbie
 
Registered: Aug 2011
Distribution: debbi
Posts: 3

Original Poster
Rep: Reputation: Disabled
I need glasses or faster brain than fingers.

"[2841] Aug 05 19:26:18 /tmp must be owned by user or root, and not writable by others"

drwx------ 12 myuser root 360 Aug 5 19:28 tmp

As written in the Big Ole' Book.

thx.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pam immediatly closes sftp session for jailed users, but not for scp Carroarmato0 Linux - Server 3 09-15-2009 08:21 AM
SSH concurrent session limit and idle session time out lasygsd Linux - Newbie 2 04-21-2009 10:11 PM
Chroot SSH problem: ssh working, not SFTP & SCP. NaCo Linux - Security 3 02-01-2009 02:23 AM
SSH / SFTP session logging phatgeezer Linux - Security 2 05-07-2007 10:42 AM
closing SSH session without killing the SFTP transfer on the remote machine stevec Linux - Software 2 04-20-2006 05:13 PM


All times are GMT -5. The time now is 05:52 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration