LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-25-2004, 09:21 AM   #1
tonyfreeman
Member
 
Registered: Sep 2003
Location: Fort worth, TX
Distribution: Debian testing 64bit at home, EL5 32/64bit at work.
Posts: 196

Rep: Reputation: 30
ssh without user password question


I have a script that "barney" must run. He needs to retrieve some information from "fred''s account on the server via sftp.

Here is the code snipette:

Code:
# FTP data
echo "DOWNLOADING DATA..."
sftp fred@myserver << EOF
	get $my_file
	quit
EOF
I've configured "myserver" so that "fred" doesn't need to provide a password for ssh,scp,sftp,etc. The above code works as expected when ran as "fred" ... but I need to run the script as "barney". When the above code is ran as "barney" I have to provide "fred's" password each time.

Any ideas how can I run the above script as "barney" without having to provide "fred's" password each time?

-- Tony
 
Old 10-25-2004, 03:18 PM   #2
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
Public Key authentication. Copy barney's PK into ~fred/.ssh/authorized_keys on myserver. You won't have to enter a password and its MUCH more secure than having users running around without passwords (which is extraordinarily dangerous in this day and age).
 
Old 10-26-2004, 11:02 AM   #3
tonyfreeman
Member
 
Registered: Sep 2003
Location: Fort worth, TX
Distribution: Debian testing 64bit at home, EL5 32/64bit at work.
Posts: 196

Original Poster
Rep: Reputation: 30
Thanks! Sometimes I overlook the simple things :-)

I was trying to do some tricks with echoing the password and also creating a channel and echoing commands to it. This really helped.

-- Tony
 
  


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
ssh without password hk_linux Linux - General 13 11-11-2010 04:20 PM
How could normal user obtain root password or change root password ckamheng Debian 18 02-18-2009 10:28 PM
Help! Cannot Add a User to User Manager or Change Root Password lennysokol Linux - General 2 06-25-2005 09:59 AM
Samba -- XP user can log in to shares but smbclient user always gets password errors ejoe Linux - Software 3 04-18-2005 10:55 AM
what is the command to make a user change their password after creating a new user? naweenio Linux - Newbie 7 01-05-2005 07:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:45 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