(old)Puppy Linux Discussion Forum
I have read many different howtos on how to install Open SSH. And found many different installation instructions.
Some of the posts are very old from 2005 or older.
Can anyone post a simple installation instruction for how to install and configure SSH on Puppy 2.17?
I want to learn how to use the SSH server and SSH client.
dot Posts: 31 Joined: Sun 18 Mar 2007, 17:15 Location: Berlin, Germany
#2 Post by dot » Sun 21 Oct 2007, 17:39
I’ve got ssh and sshd to work on Puppy 2.15. Two threads were especially helpful:
I can’t recall which of the packages mentioned there I installed — I think it was the tar.gz (second link). Either should work for Puppy 2.xx.
However, it takes some configuration to get it working. I spent several hours reading Ubuntu man pages for this — this is what I can think of off the top of my head:
— you will want to have a password for root!
— sshd wants to be invoked with its full path name, probably
/usr/sbin/sshd
— you need to have an RSA or DSA key for your computer. The ssh-keygen command should take care of that. By default, it just creates an RSA key, so there will be an error about a missing DSA key, which should not really be a problem.
— there is one direcory you have to create, /var/run/sshd I think, which should not contain anything and be readable ONLY by root.
— sshd may complain about «No user privilege separation directory» or something like that. Since you won’t be using it (you’re probably running Puppy as root), you have to disable this in /etc/ssh/sshd_config (maybe ssh_config as well) by adding this line (or modifying it):
man pages for ssh(d) should also be available online somewhere . yes:
http://unixhelp.ed.ac.uk/CGI/man-cgi?ssh+1
If this worked for you and you get X11 forwarding to work, I’d like to hear how you did it, because that is the thing I’m stuck at (despite the first link)!
[size=75][Celeron [Mendocino] 500 MHz laptop _ 128 MB RAM _ PCMCIA ethernet _ PCMCIA modem _ USB 1.1 CD burner _ Puppy 2.15CE Final frugal install _ Firefox 2 _ YAY Puppy for legacy hardware][/size]
How to start sshd on Puppy Linux?
- SSH should be installed in all puppies by default. Despite the name, this is only the client part of SSH, which allows one to log in to a host computer running another OS such as Raspberry Pi, Ubuntu, Antix, etc. Confirm this installation by looking for the ssh_config file in /etc/ssh. It is not necessary to edit this file, although in some cases a change in permissions of this file may be required to run as server. If another Linux Distro (eg Ubuntu) is running an SSH server on the same LAN, you can test the operation of the Puppy as a client as per step 10. This is not essential because we can test the operation of the SSH-client on the local or host device as per step 8 as part of the setup.
- To run SSH as a server, one needs to install SSHD — the SSH Daemon Server, which listens at port 22 (or otherwise configured) for clients requesting access to the Host Secure Shell. The host software Openssh-server can be installed from the PPM. As of LX Bionic pup, the version is 7.6p1, and on earlier Tahrpuppies it is 6.6.1p1.
- After installation of Openssh-server from the PPM, open the main SSH folder found at /etc/ssh . This folder must have two config files: ssh_config and sshd_config , plus a file called moduli. In the likely event that the default sshd_config file does not exist, download the script from: https://github.com/openssh/openssh-portable/blob/master/sshd_config This script must be pasted into a newly created text file, or an existing shell script which is gutted, populated with the sshd script and then re-named. Permissions may need to be changed to make the file editable or accessible. Failing that, copy the file from another operating Linux distribution where SSHD is installed. However, it is better to start with a default script.
- The sshd_config file must now be edited to operate under Puppy Linux. From experience, some of the lines below in the script seem to be more critical than others, as indicated in the RHS (#) comments. Remove any “#” comment tags on the LHS of the lines listed below and edit as shown. Optional lines should be able to be left as comments as these are the default configurations.
Port 22 # Optional, as this is the default AddressFamily any # Optional ? LoginGraceTime 2m # Optional PermitRootLogin yes # Critical for puppy linux PubkeyAuthentication no # Critical for initial use PasswordAuthentication yes # Critical for initial use PermitEmptyPasswords yes # Optional, otherwise use no ChallengeResponseAuthentication yes # Critical for initial use UsePAM no # Critical AllowTcpForwarding yes # Optional ? X11Forwarding yes # If one wishes to run GUI applications in the host computer X11DisplayOffset 10 # Recommended X11UseLocalhost yes # Optional ? PrintMotd no # Optional ? TCPKeepAlive yes # Optional ? Subsystem sftp /usr/lib/openssh/sftp-server # Optional ?
Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 6866/sshd
For a shorter output, which only lists port 22, use: netstat -anplt | grep :22 (care with spaces) which, if SSHD is operating should give:
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 6866/sshd
debug1: SSH2_MSG_KEXINIT sent Read from socket failed: Connection reset by peer OR ssh_exchange_identification: read: Connection reset by peer OR ssh_exchange_identification: read: Closed by unknown
How to start sshd on Puppy Linux?
- SSH should be installed in all puppies by default. Despite the name, this is only the client part of SSH, which allows one to log in to a host computer running another OS such as Raspberry Pi, Ubuntu, Antix, etc. Confirm this installation by looking for the ssh_config file in /etc/ssh. It is not necessary to edit this file, although in some cases a change in permissions of this file may be required to run as server. If another Linux Distro (eg Ubuntu) is running an SSH server on the same LAN, you can test the operation of the Puppy as a client as per step 10. This is not essential because we can test the operation of the SSH-client on the local or host device as per step 8 as part of the setup.
- To run SSH as a server, one needs to install SSHD — the SSH Daemon Server, which listens at port 22 (or otherwise configured) for clients requesting access to the Host Secure Shell. The host software Openssh-server can be installed from the PPM. As of LX Bionic pup, the version is 7.6p1, and on earlier Tahrpuppies it is 6.6.1p1.
- After installation of Openssh-server from the PPM, open the main SSH folder found at /etc/ssh . This folder must have two config files: ssh_config and sshd_config , plus a file called moduli. In the likely event that the default sshd_config file does not exist, download the script from: https://github.com/openssh/openssh-portable/blob/master/sshd_config This script must be pasted into a newly created text file, or an existing shell script which is gutted, populated with the sshd script and then re-named. Permissions may need to be changed to make the file editable or accessible. Failing that, copy the file from another operating Linux distribution where SSHD is installed. However, it is better to start with a default script.
- The sshd_config file must now be edited to operate under Puppy Linux. From experience, some of the lines below in the script seem to be more critical than others, as indicated in the RHS (#) comments. Remove any “#” comment tags on the LHS of the lines listed below and edit as shown. Optional lines should be able to be left as comments as these are the default configurations.
Port 22 # Optional, as this is the default AddressFamily any # Optional ? LoginGraceTime 2m # Optional PermitRootLogin yes # Critical for puppy linux PubkeyAuthentication no # Critical for initial use PasswordAuthentication yes # Critical for initial use PermitEmptyPasswords yes # Optional, otherwise use no ChallengeResponseAuthentication yes # Critical for initial use UsePAM no # Critical AllowTcpForwarding yes # Optional ? X11Forwarding yes # If one wishes to run GUI applications in the host computer X11DisplayOffset 10 # Recommended X11UseLocalhost yes # Optional ? PrintMotd no # Optional ? TCPKeepAlive yes # Optional ? Subsystem sftp /usr/lib/openssh/sftp-server # Optional ?
Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 6866/sshd
For a shorter output, which only lists port 22, use: netstat -anplt | grep :22 (care with spaces) which, if SSHD is operating should give:
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 6866/sshd
debug1: SSH2_MSG_KEXINIT sent Read from socket failed: Connection reset by peer OR ssh_exchange_identification: read: Connection reset by peer OR ssh_exchange_identification: read: Closed by unknown