Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-10-2009, 07:57 AM   #1
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:

#rsync /opt/sync_source/ root@
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
Registered: Jul 2009
Location: Buenos Aires, Argentina
Distribution: fedora, slackware, *bsd
Posts: 42

Rep: Reputation: 17
try using the expect command,
Old 08-10-2009, 11:03 AM   #3
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,087

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
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.


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 - 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 > Forums > Linux Forums > Linux - Newbie

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

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