Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] logowanie przez ssh i haslo
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Polskie forum (Polish) Polish OTW
View previous topic :: View next topic  
Author Message
bartmarian
Guru
Guru


Joined: 28 Nov 2005
Posts: 548

PostPosted: Thu Apr 05, 2007 10:48 am    Post subject: [SOLVED] logowanie przez ssh i haslo Reply with quote

Witam,
nawiazujac do watku o wyslaniu polecen, teraz problem mam z podaniem hasla,
ssh niestety nie przyjmuje nic w stylu:
Code:
ssh user:pass@host

jak podac haslo w skrypcie ?

Pozdrawiam


Last edited by bartmarian on Thu Apr 05, 2007 2:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
Raku
Bodhisattva
Bodhisattva


Joined: 28 Feb 2004
Posts: 2375
Location: Poland

PostPosted: Thu Apr 05, 2007 12:43 pm    Post subject: Re: logowanie przez ssh i haslo Reply with quote

bartmarian wrote:
jak podac haslo w skrypcie ?

możesz albo używać wynalazków w stylu expect, albo konfigurujesz sobie dostęp po kluczu RSA/DSA.
_________________
raku

Powered by Archlinux ;-)
Back to top
View user's profile Send private message
bartmarian
Guru
Guru


Joined: 28 Nov 2005
Posts: 548

PostPosted: Thu Apr 05, 2007 2:06 pm    Post subject: Reply with quote

dzieki Raku, mam co chcialem :)

u mnie skrypt wyglada tak:
Code:
#!/usr/bin/expect --
set timeout 30
set IP [lindex $argv 0]

spawn bash -c "cat /plik/z/poleceniami/dla/zdalnego/$IP | ssh admin@$IP ''"
expect "password:"
send "haslo-do-zdalnego
"
interact
wait

w moim przypadku (mikrotik) plik to polecenia typu:
Code:

interface bridge filter add chain=forward mac-protocol=ipx action=drop comment="" disabled=no
interface bridge filter add chain=input mac-protocol=ipx action=drop comment="" disabled=no

ale w miedzy czasie wyczytalem ze switche zarzadzalne tez maja dostep z ssh, wiec mozliwosci
konfiguracji roznosci w sieci rosna :)

Pozdrawiam
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Polskie forum (Polish) Polish OTW All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum