LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 10-24-2006, 08:50 AM   #1
Lenux78
Member
 
Registered: Jun 2006
Location: Venezuela
Distribution: A Lot
Posts: 40

Rep: Reputation: 15
Redirecting input for ssh...


Hi everybody,

I got a question... I want to make trought command lines an ssh to a remote host.. for example: ssh root@nemo,

As you know, the command output will retry the password frase to the prompt.. but i want to do it redirecting the input... I tried this...

#!/bin/sh

ssh root@nemo << EOF
passfrase


but it doesn't work... how could i do it??? I know there is other way to do that but i don't want to activate a public password..

So there's someone who knows how to do it this way??? Redirecting the input for ssh??


Regards...
 
Old 10-24-2006, 09:14 AM   #2
lucktsm
Member
 
Registered: May 2004
Location: Atlanta, GA USA
Distribution: Redhat ES4, FC4, FC5, slax, ubuntu, knoppix
Posts: 155

Rep: Reputation: 30
Couple of thoughts.. Are you making a brute force script? Also, allowing root to login remote via SSH is a security risk.
 
Old 10-24-2006, 10:09 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Use the "-i credentials-file" option when calling ssh, or use the authorized-keys-file.
See the ssh manpage for details. I don't know what you want to do, but I would recommend reading the manpages for ssh_config, sshd_config and ssh. If only a handfull of users are allowed to login to ssh, then consider the "Allow Users" option. All other users will be denied. This is easier than using "DenyUsers" to deny system users access. Root and system users well known, and someone trying to break in will most certainly try each one. If you need automated access, look into rsync. And/or consider "AllowRootLogin forced-commands-only".

Here is a link for RSYNC & SSH with automated login:
https://people.chem.umass.edu/wiki/i...utomated_Login

Last edited by jschiwal; 10-24-2006 at 10:12 AM.
 
Old 10-24-2006, 01:00 PM   #4
Lenux78
Member
 
Registered: Jun 2006
Location: Venezuela
Distribution: A Lot
Posts: 40

Original Poster
Rep: Reputation: 15
Hi...

thanks for the suggestions.. and some answers...

1).. no, it is not a brute force script but it could be used for that...But in my case i just want to automate a process in a very simple script...
2).. the root@nemo it is just an example.. but thanks for the security thing...

That's interesting using credential files... but i know i saw in some script, which i don't remember, a way to make conections with ssh just using ssh and some redirection for stdin... but i really really don't remember how to do that... it didn't use any credentials or autorized-keys which I know that's a better way and more secure... but by now i just want to make that redirection of stdin..

how could i do that???

Thanks for everything..

Regards...

if you
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Input redirecting Thomas Ene Linux - Newbie 4 03-30-2006 12:16 AM
Automating tasks by redirecting input lsgko Linux - Software 4 02-26-2006 11:47 PM
Ctrl+Shift Unicode input gone, after installing Japanese Input Methodes polemon Linux - Newbie 1 09-20-2005 05:17 PM
Sendmail: timeout waiting for input from local during Draining Input andrewstr Linux - Software 0 07-14-2004 01:43 PM
ssh & sftp, DISCONNECTED:corrupted MAC on input frieza Linux - Networking 6 02-16-2003 09:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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