Showing results for 
Search instead for 
Did you mean: 
Valued Contributor III

sshd on Nios II uClinux with buildroot

I recently built a working sshd for uClinux after a bunch of trouble, so here's a guide for others who want sshd too. I assume that you use the (very nice) buildroot environment on Linux for making your uClinux kernels and roots. See the forum topic on it for how to set it up. To make sshd, here's what I did: 


Step 1: Build the openssl package in buildroot (needed by openssh) 


- Download the attached and openssl-configure.patch (rename them to that) and put them into buildroot/package/openssl (overwriting the existing 

- Go to the buildroot directory. 

- Run buildroot's menuconfig and select openssl: make menuconfig 

- Build buildroot: make 


Step 2: Build the openssh port in uClinux-dist 


- Get the uClinux-dist archive: (

- Download the attached openssh-cross.patch (rename it to that) and put it somewhere convenient. 

- Extract the uClinux-dist/user/ssh directory and go into it. 

- Patch it: patch -p1 < openssh-cross.path 

- Make its autoheader 

- Configure it: ./configure --host=nios2-linux --with-cflags="-D__uClinux__ -DUSE_VFORK -Dfork=vfork -DHAVE_NANOSLEEP" --with-ldflags="-elf2flt=-s16000" 

- Build it: make 

- Install it: make install DESTDIR=~/buildroot/build_nios2/root (it will fail with an error in check-config saying that it can&#39;t execute sshd, but this is okay) 


Step 3:  


- Add the following in your inetd.conf: 

ssh    stream    tcp    nowait    root    /sbin/sshd -i 


(It doesn&#39;t work if you run it as a standalone daemon.) 


Now just make your rootfs/kernel and you&#39;re done.
0 Kudos
1 Reply
Valued Contributor III

Good work tschmelcher. Do you happen to know what version of buildroot you were using for this?

0 Kudos