LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-10-2009, 07:57 AM   #1
FireRaven
Member
 
Registered: Apr 2006
Location: Australia
Distribution: Debian Squeeze
Posts: 135

Rep: Reputation: 18
Can I macro auto type in a password?


Hi, I want to write a short script (or line) to run:

Code:
#rsync /opt/sync_source/ root@192.168.1.3:/opt/sync_dest/
root@192.168.1.3's password: (CAN IT AUTOTYPE THE PASSWORD HERE?)
#
So that single rsync line I want it to include/auto-type the password so I don't have to do it each time, is it possible without setting with ssh_keys?
 
Old 08-10-2009, 09:05 AM   #2
mek
Member
 
Registered: Jul 2009
Location: Buenos Aires, Argentina
Distribution: fedora, slackware, *bsd
Posts: 42

Rep: Reputation: 17
try using the expect command,

http://expect.nist.gov/
 
Old 08-10-2009, 11:03 AM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Making root's password visible like this is a very bad idea.

A much better idea is to set up key-based authentication for ssh which will allow logins without using passwords (in fact you should DENY ssh logins using passwords, and ACCEPT only ssh logins with key-based authentication), and is much more secure.
 
  


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
SSH - password macro? piercey Programming 2 07-16-2008 04:25 AM
type sudo command then i cant type in a password turoblaztr Linux - General 5 01-14-2007 09:58 AM
installing redhat 8.0 when text login in I cannot type password?? I type root scrist Linux - General 4 04-22-2006 02:20 AM
Simple Ooo BASIC Macro problem: "connot coerce argument type..." tredegar Linux - Software 0 08-14-2005 10:00 AM
#defining a macro inside a macro? saravkrish Programming 1 05-24-2005 09:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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