SSH Confusion -- Question

7150 linux.1 at litenverden.com
Fri Oct 26 01:42:07 CEST 2007


I am here in the networking
(http://wiki.openmoko.org/wiki/USB_Networking) wiki:

SSH Extras

If you get fed up with typing root at 192.168.0.202, on your PC edit
/etc/hosts and add an entry for 'phone'

192.168.0.202 phone

then edit ~/.ssh/config (or create it) and add

host phone
user root

then all you need to do is type

# ssh phone

To avoid ssh added a new line for every ssh host-key to you known_hosts
you can add the following to the phone section in ~/.ssh/config

 UserKnownHostsFile /dev/null

My question is, what does the tilde mean in the filename: ~/.ssh/config

I think I have to create this file, but am a bit apprehensive about
creating .ssh/config in the root directory. That directory/file does not
presently exist there.

Thanks!

George


-----

Following is my current log of networking activities:

Neo-Networking

10-24-2007: Attempt to establish basic network connection to Neo.
Running Ubuntu 7.10 (gutsy)

>From the wiki: http://wiki.openmoko.org/wiki/USB_Networking#Automatic_method

Edit /etc/network/interfaces file ():

auto usb0
iface usb0 inet static
        address 192.168.0.200
        netmask 255.255.255.0
        network 192.168.0.0
        up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &
        up echo 1 > /proc/sys/net/ipv4/ip_forward &
        up iptables -P FORWARD ACCEPT &
        down iptables -D POSTROUTING -t nat -j MASQUERADE -s
192.168.0.0/24 &

Completed as root.

Patch /etc/udev/rules.d/85-ifupdown.rules:

Ubuntu feisty appears to have a bug where ifdown is not run when the
interface is unplugged, meaning this only works once after the system is
booted. One can patch /etc/udev/rules.d/85-ifupdown.rules, editing the
two lines at the end of the file:

SUBSYSTEM=="net", DRIVERS=="?*", GOTO="net_start"
GOTO="net_end"

LABEL="net_start"

# Bring devices up and down only if they're marked auto.
# Use start-stop-daemon so we don't wait on dhcp
ACTION=="add",          RUN+="/sbin/start-stop-daemon --start
--background --pidfile /var/run/network/bogus --startas /sbin/ifup --
--allow auto $env{INTERFACE}"

LABEL="net_end"

ACTION=="remove",       RUN+="/sbin/start-stop-daemon --start
--background --pidfile /var/run/network/bogus --startas /sbin/ifdown --
--allow auto $env{INTERFACE}"

the bug is that the LABEL="net_end" is after the ACTION line in the
distribution.

I checked my gutsy file. It was wrong, so I changed it as root to the
feisty specification above.

I restarted the computer.

Ping test:

y7150 at Fluffy:~$ ping 192.168.0.200
PING 192.168.0.200 (192.168.0.200) 56(84) bytes of data.
64 bytes from 192.168.0.200: icmp_seq=1 ttl=64 time=0.059 ms
64 bytes from 192.168.0.200: icmp_seq=2 ttl=64 time=0.054 ms
64 bytes from 192.168.0.200: icmp_seq=3 ttl=64 time=0.053 ms

--- 192.168.0.200 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.053/0.055/0.059/0.006 ms
y7150 at Fluffy:~$

Success.

10-24-07: Attempt to establish ssh connection to Neo

As root

Performed: ifconfig usb0 192.168.0.200 netmask 255.255.255.0

then: ping -I usb0 192.168.0.202

Success

then: /sbin/route add -host 192.168.0.202/32 dev usb0

then: ssh root at 192.168.0.202

The authenticity of host '192.168.0.202 (192.168.0.202)' can't be
established.
RSA key fingerprint is [hex dotted string].
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added '192.168.0.202' (RSA) to the list of known hosts.
root at 192.168.0.202's password:
root at fic-gta01:~$

Success -- ssh logon also works with sudo



More information about the device-owners mailing list