SSH terminal client
A client of the Terminal service that connects to a shell on a remote SSH server. It is configured with a "host" file found in its root directory with the following format: <host name="sdf-eu.org" port="22" user="root" pass="foo" known="yes"/> The port, pass, and known attributes are optional. The client will first try to authenticate with a keypair found in the root directory with a fallback to password authentication. The client will automatically disconnect from hosts that are not found in "/known_hosts", unless the "known" attribute is set to the negative in the host file.
This commit is contained in:
committed by
Norman Feske
parent
2ba33d38a9
commit
5fff9d4b5b
177
run/ssh_client.run
Normal file
177
run/ssh_client.run
Normal file
@@ -0,0 +1,177 @@
|
||||
#
|
||||
# \brief Test of ssh_client
|
||||
# \author Emery Hemingway
|
||||
#
|
||||
|
||||
if {[have_spec odroid_xu] || [have_spec linux] ||
|
||||
[expr [have_spec imx53] && [have_spec trustzone]]} {
|
||||
puts "Run script does not support this platform."
|
||||
exit 0
|
||||
}
|
||||
|
||||
set build_components {
|
||||
app/ssh_client
|
||||
drivers/nic
|
||||
lib/vfs/import
|
||||
lib/vfs/lwip
|
||||
}
|
||||
|
||||
proc gpio_drv { } { if {[have_spec rpi] && [have_spec hw]} { return hw_gpio_drv }
|
||||
if {[have_spec rpi] && [have_spec foc]} { return foc_gpio_drv }
|
||||
return gpio_drv }
|
||||
|
||||
lappend_if [have_spec gpio] build_components drivers/gpio
|
||||
|
||||
source ${genode_dir}/repos/base/run/platform_drv.inc
|
||||
append_platform_drv_build_components
|
||||
|
||||
lappend_if [expr {[nic_drv_binary] == "nic_drv"}] build_components drivers/nic
|
||||
lappend_if [expr {[nic_drv_binary] == "usb_drv"}] build_components drivers/usb
|
||||
|
||||
build $build_components
|
||||
|
||||
create_boot_directory
|
||||
|
||||
import_from_depot \
|
||||
genodelabs/src/[base_src] \
|
||||
genodelabs/pkg/[drivers_interactive_pkg] \
|
||||
genodelabs/src/init \
|
||||
genodelabs/pkg/terminal \
|
||||
genodelabs/src/input_filter \
|
||||
|
||||
append config {
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="CPU"/>
|
||||
<service name="IO_MEM"/>
|
||||
<service name="IO_PORT"/>
|
||||
<service name="IRQ"/>
|
||||
<service name="LOG"/>
|
||||
<service name="PD"/>
|
||||
<service name="RAM"/>
|
||||
<service name="RM"/>
|
||||
<service name="ROM"/>
|
||||
</parent-provides>
|
||||
<default caps="100"/>
|
||||
<default-route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</default-route>}
|
||||
|
||||
append_platform_drv_config
|
||||
|
||||
append_if [have_spec gpio] config "
|
||||
<start name=\"[gpio_drv]\" caps=\"140\">
|
||||
<resource name=\"RAM\" quantum=\"4M\"/>
|
||||
<provides><service name=\"Gpio\"/></provides>
|
||||
<config/>
|
||||
</start>"
|
||||
|
||||
append config {
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides> <service name="Timer"/> </provides>
|
||||
</start>
|
||||
<start name="nic_drv" caps="120">
|
||||
<binary name="} [nic_drv_binary] {"/>
|
||||
<resource name="RAM" quantum="16M"/>
|
||||
<provides> <service name="Nic"/> </provides>
|
||||
} [nic_drv_config] {
|
||||
</start>
|
||||
|
||||
<start name="fb_drv" caps="200">
|
||||
<resource name="RAM" quantum="10M"/>
|
||||
<provides><service name="Framebuffer"/></provides>
|
||||
<config buffered="yes"/>
|
||||
</start>
|
||||
|
||||
<start name="ps2_drv">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Input"/></provides>
|
||||
</start>
|
||||
|
||||
<start name="input_filter" caps="80">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides> <service name="Input"/> </provides>
|
||||
<config>
|
||||
<input label="ps2"/>
|
||||
<output>
|
||||
<chargen>
|
||||
<input name="ps2"/>
|
||||
<repeat delay_ms="230" rate_ms="90"/>
|
||||
<include rom="en_us.chargen"/>
|
||||
<include rom="special.chargen"/>
|
||||
</chargen>
|
||||
</output>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Input" label="ps2"> <child name="ps2_drv"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="terminal">
|
||||
<resource name="RAM" quantum="2M"/>
|
||||
<provides><service name="Terminal"/></provides>
|
||||
<route>
|
||||
<service name="ROM" label="config">
|
||||
<parent label="terminal.config"/> </service>
|
||||
<service name="Input">
|
||||
<child name="input_filter"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="ssh_client" caps="500">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<config>
|
||||
<vfs>
|
||||
<ram/>
|
||||
<dir name="dev">
|
||||
<log/> <null/> <inline name="rtc">2000-01-01 00:00</inline>
|
||||
<inline name="random">01234567890123456789</inline>
|
||||
</dir>
|
||||
<dir name="socket"> <lwip dhcp="yes"/> </dir>
|
||||
|
||||
<import>
|
||||
<!-- sdf-eu.org -->
|
||||
<inline name="host"><host name="178.63.35.194" user="new" known="no"/></inline>
|
||||
</import>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" socket="/socket"/>
|
||||
</config>
|
||||
</start>
|
||||
</config>
|
||||
}
|
||||
|
||||
install_config $config
|
||||
|
||||
# generic modules
|
||||
set boot_modules {
|
||||
libc.lib.so
|
||||
libcrypto.lib.so
|
||||
libm.lib.so
|
||||
libssh.lib.so
|
||||
ssh_client
|
||||
vfs_import.lib.so
|
||||
vfs.lib.so
|
||||
vfs_lwip.lib.so
|
||||
zlib.lib.so
|
||||
}
|
||||
|
||||
# platform-specific modules
|
||||
append_platform_drv_boot_modules
|
||||
|
||||
lappend boot_modules [nic_drv_binary]
|
||||
|
||||
lappend_if [have_spec ps2] boot_modules ps2_drv
|
||||
lappend_if [have_spec framebuffer] boot_modules fb_drv
|
||||
|
||||
lappend_if [have_spec gpio] boot_modules [gpio_drv]
|
||||
|
||||
build_boot_image $boot_modules
|
||||
|
||||
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
|
||||
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
|
||||
append qemu_args " -net user -net dump,file=[run_dir].pcap"
|
||||
|
||||
run_genode_until forever
|
||||
Reference in New Issue
Block a user