
Due to a course about real time operating systems I was to install a QNX 6.4.1 on my computer. Having it installed under VMWare Player i wanted to have a possibility to connect to QNX via WinSCP to transfer files easily. That wasn’t that easy, it took me some time, but there’s a solution how to run sshd server under QNX 6.4.1 RTOS:
You have to run sshd with full path, otherwise you’ll get “sshd re-exec requires execution with an obsolete path” error message. So:
/usr/sbin/sshd
But then we get such an output:
Could not load host key: /etc/ssh/ssh_host_key
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.
We need to generate those files. What is very important – while generating – you must provide NO passwords, otherwise sshd will not be able to read those files. Random numbers generator should be also fired, so:
random -t
ssh-keygen -t rsa -f /etc/ssh/ssh_host_key -b 1024
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
We should be able to launch sshd server. Hooray!
But wait, it’s impossible to connect via ssh with user root under this OS! We have to add a new user. Under QNX there’s different command for this, comparing to the other *nixes. Type the following, where user_name is your new user name:
passwd user_name
After that answer for a few questions. Lastly you have to update /etc/group file. A little help for understanding groups is here: http://www.qnx.com/developers/docs/qnx_4.25_docs/qnx4/user_guide/accounts.html . You can edit this file by:
vi /etc/group
Add your recently created username to adequate groups, my group file look like that:
root:x:0:root
bin:x:1:root,bin,profetes
daemon:x:2:daemon,profetes
sys:x:3:root,bin,adm,profetes
adm:x:4:root,adm,daemon,profetes
tty:x:5:root,profetes
sshd:x:6:root,profetes
mail:x:40:mail
news:x:50:news
uucp:x:60:uucp
ftp:x:80:ftp,profetes
guest:x:90:
nobody:x:99:
After that you should be able to connect to your QNX via ssh! Congratualtions!
To have sshd launched everytime QNX boots up you have to add it to launching scripts. Without it you’ll have to fire /ust/sbin/sshd every time you power on your machine.
Any feedback is appreciated