Witam.
Chciałbym, żeby przy starcie systemu automatycznie nawiązywane było połączenie ssh z inną maszyną. Zrobiłem wszystko co trzeba żeby logowanie nie wymagało hasła i wrzuciłem do autostartu skrypt z autossh. Wszystko działa jak trzeba z tym, że po starcie systemu na konsoli od razu widniej zalogowana sesja do zdalnej maszyny.
W jaki sposób uruchamiać skrypt przy starcie aby, na głównej konsoli po starcie systemu operacyjnego widniał tradycyjny obraz tj logi.
[+] Nawi
Fragment podręcznika systemowego:
powinno zalogować Cię do zdalnej maszyny, a dzięki ,,-f'' proces ssh będzie działał w tle.
Dodane:
Nie zauważyłem, że używasz ,,autossh'', ale to nie problem. Przełącznik ,,-f'' działa tak samo.
Fragment:
Czyli zakładając, że klucze już są utworzone i załadowane polecenie w skrypcie:" pisze:-f Requests ssh to go to background just before command execution. This is useful if ssh is going to ask for
passwords or passphrases, but the user wants it in the background. This implies -n. The recommended way to
start X11 programs at a remote site is with something like ssh -f host xterm.
If the ExitOnForwardFailure configuration option is set to “yes”, then a client started with -f will wait for
all remote port forwards to be successfully established before placing itself in the background
Kod: Zaznacz cały
ssh -2 -f moj_login@zdalny_host
Dodane:
Nie zauważyłem, że używasz ,,autossh'', ale to nie problem. Przełącznik ,,-f'' działa tak samo.
Fragment:
" pisze:-f' causes autossh to drop to the background before running ssh. The -f flag is stripped from arguments passed to ssh. Note that there is a crucial a difference between -f with autossh, and -f with ssh: when used with autossh ssh will be unable to ask for passwords or passphrases.