LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-05-2007, 02:19 PM   #1
pr0gr4mm3r
LQ Newbie
 
Registered: Jul 2006
Location: Behind You
Distribution: Ubuntu Fiesty 7.04
Posts: 14

Rep: Reputation: 0
Simple Shell Question Regarding Password Prompts


Is there a way to merge a shell command along with the required password onto one line? For example, I want to write a script to mount an sshfs point automatically if needed, but it always requests the password for the host. Is there a way to send the password along with the mount command? Thanks!
 
Old 03-05-2007, 02:24 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,397

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
if you want to do sshfs properly, then use shared key authentication instead.
 
Old 03-05-2007, 02:43 PM   #3
pr0gr4mm3r
LQ Newbie
 
Registered: Jul 2006
Location: Behind You
Distribution: Ubuntu Fiesty 7.04
Posts: 14

Original Poster
Rep: Reputation: 0
The fist time I did it, it asked to receive an RSA Key. I accepted it, but it still asks for the password (for the host machine) to connect.
 
Old 03-05-2007, 02:44 PM   #4
x_terminat_or_3
Member
 
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342

Rep: Reputation: 38
Shared Keys

I concur.

You should always opt for shared key authentication instead of password logins.

There are several malicious scripts out there that will try to brute force guess your SSH password. Those attacks will fail 100% of the time if you disable password logins and only allow shared key authentication.

http://kmself.home.netcom.com/Linux/FAQs/sshrsakey.html

Now a good thing by using shared keys is that you can have a key for the root account, and when you want to ssh a box while running as your user (you are running as your user aren't you!), then all you would need to do is:

su -c 'ssh box_to_connect_to'

Enter your local root password to be able to use the key, and then you will be logged on to the remote host without the need for a password.
 
Old 03-05-2007, 02:48 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,397

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
Quote:
Originally Posted by pr0gr4mm3r
The fist time I did it, it asked to receive an RSA Key. I accepted it, but it still asks for the password (for the host machine) to connect.
that's not the same thing at all. check the shared guide guide in the tutorial section of this site, or indeed one of hundreds of other hits from google about rsa preshared keys
 
  


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
Rdesktop Server & Password Prompts? DHR Linux - Software 1 12-12-2008 11:52 AM
general questions re shell, prompts, X carlos88 Linux - Newbie 1 07-23-2006 01:39 PM
SVN and Apache, multiple password prompts watsoncj Linux - Software 0 10-10-2005 01:36 PM
Shell prompts and keymaps amnesty_puppy Linux - Newbie 8 08-17-2004 06:52 PM
mount - a passwdless 98 share prompts for password bkeating Linux - Software 1 11-22-2002 01:06 PM


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