Skip navigation.
Home
The QNX Community Portal

View topic - Telnet

Telnet

Discussion about the general applications that run on QNX6

Re: Telnet

Postby AshiGupta » Tue Nov 15, 2016 9:06 am

ln -sP Target LinkName

i have created symlink for files used for passwd like, passwd, shadow, opasswd, oshadow, group but this doesnt work.

Ashi
AshiGupta
Active Member
 
Posts: 19
Joined: Wed Aug 24, 2016 11:09 am

Re: Telnet

Postby nico04 » Tue Nov 15, 2016 1:18 pm

There might be a permission problem.

You can try the following :
- Create a directory called "etc" on your flash drive : mkdir /my_flash_drive/etc
- Copy "/etc" content to the newly created directory : cp -r /etc /my_flash_drive/etc
- Redirect "/etc" on the newly created directory : ln -sP /my_flash_drive/etc /etc
- Create user and password
- Copy "/etc/shadow" and "/etc/passwd" in your BSP sources files (in "prebuilt" directory).
- Regenerate your BSP
nico04
Active Member
 
Posts: 79
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Telnet

Postby AshiGupta » Tue Nov 15, 2016 1:35 pm

Thanks, i tried this and it worked :)

Thank you for your support.

Ashi
AshiGupta
Active Member
 
Posts: 19
Joined: Wed Aug 24, 2016 11:09 am

Re: Telnet

Postby nico04 » Tue Nov 15, 2016 1:56 pm

You're welcome :)
nico04
Active Member
 
Posts: 79
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Telnet

Postby denkelly » Wed Nov 16, 2016 2:33 pm

>>>I have a flash drive where i can create files at run time...is there is any way if we can port /etc or passwd related files in my editable flash drive ?

Sure. Assuming you have created the /etc folder on the flash drive (as you want it), just mount the flash drive at /.
denkelly
Senior Member
 
Posts: 161
Joined: Sat Aug 02, 2008 3:27 pm

Re: Telnet

Postby AshiGupta » Mon Dec 05, 2016 8:18 am

Hi,

You can copu all files related to user account in editable flash drive by creating a folder there as /etc and can create a symbolic link using below syntax
ln -sP pathToDirecroty /etc
Where: pathToDirectory is path to etc directory created in editable flash drive

another option is u can have .efs file system and can mount /etc drive with user account related files in editable flash drive.

Hope this help.
AshiGupta
Active Member
 
Posts: 19
Joined: Wed Aug 24, 2016 11:09 am

Re: Telnet

Postby AshiGupta » Mon Dec 05, 2016 8:25 am

Hi nico04

I have one more problem related to Telnet login.

I want to login Telnet using any other user apart from root. So i created a new user and deleted root from passwd file. But after this i am not able to telnet my device. If i recreate root user it works.
How i can remove root user ?

Ashi
AshiGupta
Active Member
 
Posts: 19
Joined: Wed Aug 24, 2016 11:09 am

Re: Telnet

Postby nico04 » Mon Dec 05, 2016 8:44 am

Have you modified /etc/inetd.conf file ?
nico04
Active Member
 
Posts: 79
Joined: Wed Sep 29, 2010 9:59 am
Location: France

Re: Telnet

Postby AshiGupta » Mon Dec 05, 2016 4:09 pm

Yes i tried modifying inetd.conf file by changing user name for Telnet but it didnt worked.
AshiGupta
Active Member
 
Posts: 19
Joined: Wed Aug 24, 2016 11:09 am

Re: Telnet

Postby Tim » Mon Dec 05, 2016 5:42 pm

Can you post your modified inetd.conf file here.

Tim
Tim
Senior Member
 
Posts: 1390
Joined: Wed Mar 10, 2004 12:28 am

Re: Telnet

Postby AshiGupta » Mon Dec 05, 2016 5:50 pm

Here is my inetd.conf file..i am not sure if i have done correct changes...my user name is testUser

# Internet services syntax:
# <service_name> <socket_type> <proto> <flags> <user> <server_pathname> <args>
#
# Time service is used for clock syncronization.
#
#time stream tcp nowait root internal
#time dgram udp wait root internal

#
# Ftp and telnet are standard Internet services.
#
ftp stream tcp nowait root /proc/boot/ftpd in.ftpd -l
telnet stream tcp nowait testUser /proc/boot/telnetd in.telnetd

#
# Shell, login, exec are BSD protocols.
#
shell stream tcp nowait root /proc/boot/rshd in.rshd
login stream tcp nowait root /proc/boot/rlogind in.rlogind
exec stream tcp nowait root /proc/boot/rexecd in.rexecd

# Tftp service is provided primarily for booting. Most sites run this
# only on machines acting as "boot servers".
#
#tftp dgram udp wait root /proc/boot/tftpd in.tftpd

# Systat and netstat give out user information which man be
# valuable to potential "system crackers." Many sites choose to disable
# some or all of these services to improve security.
#
#systat stream tcp nowait root /bin/ps ps -auwwx
#netstat stream tcp nowait root /proc/boot/netstat netstat -f inet

# IPv6 services.
# The only difference with the above is "tcp6" instead of "tcp".
# Be sure to enable both "tcp" and "tcp6" when you need service for
# both IPv4/v6.
#
#ftp stream tcp6 nowait root /proc/boot/ftpd ftpd -ll
telnet stream tcp6 nowait testUser /proc/boot/telnetd telnetd
#shell stream tcp6 nowait root /proc/boot/rshd rshd -L
#login stream tcp6 nowait root /proc/boot/rlogind rlogind -L
#tftp dgram udp6 wait root /proc/boot/tftpd tftpd -l -s /tftpboot
AshiGupta
Active Member
 
Posts: 19
Joined: Wed Aug 24, 2016 11:09 am

Re: Telnet

Postby Tim » Mon Dec 05, 2016 7:23 pm

What you have looks reasonable at a quick glance.

Now for the important question. Can your 'testUser' actually log in? There is more to logging in than just having a username/password.

http://www.qnx.com/developers/docs/6.3. ... login.html

Ie you may need a home directory for your user and potentially a group (unless you want to put testUser in the super user group with root). If testUser can't validly log in then telnet isn't going to work.

Tim
Tim
Senior Member
 
Posts: 1390
Joined: Wed Mar 10, 2004 12:28 am

Re: Telnet

Postby AshiGupta » Tue Dec 06, 2016 5:49 am

I have a home directory for my testUser and also if there is a root entry in 'passwd' file i am able to login via telnet for my testUser but if i remove root from 'passwd' file it doesnt work.
AshiGupta
Active Member
 
Posts: 19
Joined: Wed Aug 24, 2016 11:09 am

Re: Telnet

Postby Tim » Tue Dec 06, 2016 6:27 pm

So you are saying the following is true:

Password file: Contains root & testUser
- Both root & testUser can log in with telnet

Password file: Contains testUser
- Neither root or testUser can log in with telnet.

That seems strange that root would be required to run telnet.

Here's a knowledge base article I found on telnet under qnx for embedded targets

http://www.qnx.com/support/knowledgebas ... 000000SzKu

Presumably you should be able to replace 'root' with testUser and it should work fine.

Tim
Tim
Senior Member
 
Posts: 1390
Joined: Wed Mar 10, 2004 12:28 am

Re: Telnet

Postby AshiGupta » Wed Dec 07, 2016 6:19 am

I am able to disable root login successfully by replacing /bin/sh as /bin/nologin in 'passwd' file.
Removing root user was not allowing to login Telnet service. I tried multiple options but didn;t worked so i found this workaround to disable root login.

Ashi
AshiGupta
Active Member
 
Posts: 19
Joined: Wed Aug 24, 2016 11:09 am

Previous

Return to QNX6 - Applications

Who is online

Users browsing this forum: Bing [Bot] and 1 guest