Handbook Page ID 118

Converting Ubuntu Linux Computer to Sharing Gateway

In order to use an Ubuntu Linux installed computer as a sharing gateway, you simply need to install OpenSSH, an open source SSH server software. For more information about OpenSSH, please visit http://openssh.org/.

The steps described below should be executed from a command terminal such as [ Applications ] » [ Accessories ] » "Terminal".

1. Check if OpenSSH is already installed

At the command prompt, try connecting to localhost via SSH.

Example:

$ ssh localhost

If you already have SSH server running, you should get an output similar to the following:

The authenticity of host 'localhost (::1)' can't be established.
RSA key fingerprint is ...

If it's not installed,

ssh: connect to host localhost port 22: Connection refused

2. Install OpenSSH

If you do not have an SSH server running, execute the following command to install OpenSSH server.

$ sudo apt-get install openssh-server

After installing the package, you do not need to change the default settings.
For more information about the package, please visit:
https://help.ubuntu.com/9.04/serverguide/C/openssh-server.html


3. Check if your Ubuntu Linux can resolve Windows computer names

At the command prompt, try reaching one of your Windows computer by its name. For example, if the name of your Windows computer is "nina009", try entering the following command:

$ ssh nina009

If the name "nina009" can be properly resolved to an IP address, you should see an output similar to the following:

ssh: connect to host nina009 port 22: Connection refused

If the name cannot be resolved,

ssh: Could not resolve hostname nina009: Name or service not known

4. Install name resolution component

If your Ubuntu Linux cannot resolve Windows computer names, install the following package:

winbind

For more information about the package, please visit:
http://packages.ubuntu.com/jaunty/winbind

To install this package, execute the following command:

$ sudo apt-get install winbind

After successfully installing the package, you need to edit "/etc/nsswitch.conf" file. Open this file with 'vi' or any text file editor, and change the line:

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
to
hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4 wins

Please note that you need to run the editor with 'sudo' since "/etc/nsswitch.conf" can only be edited by system administrator. For example, if you're using 'vi',

$ sudo vi /etc/nsswitch.conf

Please also note that if you don't wish to use the "winbind" package mentioned above, you can manually add entries to "/etc/hosts" file for Windows computers.


5. Done!