View topic - Telnet

Page 2 of 2

Re: Telnet

PostPosted: Tue Nov 15, 2016 9:06 am
by AshiGupta
ln -sP Target LinkName

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

Ashi

Re: Telnet

PostPosted: Tue Nov 15, 2016 1:18 pm
by nico04
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

Re: Telnet

PostPosted: Tue Nov 15, 2016 1:35 pm
by AshiGupta
Thanks, i tried this and it worked :)

Thank you for your support.

Ashi

Re: Telnet

PostPosted: Tue Nov 15, 2016 1:56 pm
by nico04
You're welcome :)

Re: Telnet

PostPosted: Wed Nov 16, 2016 2:33 pm
by denkelly
>>>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 /.

Re: Telnet

PostPosted: Mon Dec 05, 2016 8:18 am
by AshiGupta
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.

Re: Telnet

PostPosted: Mon Dec 05, 2016 8:25 am
by AshiGupta
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

Re: Telnet

PostPosted: Mon Dec 05, 2016 8:44 am
by nico04
Have you modified /etc/inetd.conf file ?

Re: Telnet

PostPosted: Mon Dec 05, 2016 4:09 pm
by AshiGupta
Yes i tried modifying inetd.conf file by changing user name for Telnet but it didnt worked.

Re: Telnet

PostPosted: Mon Dec 05, 2016 5:42 pm
by Tim
Can you post your modified inetd.conf file here.

Tim

Re: Telnet

PostPosted: Mon Dec 05, 2016 5:50 pm
by AshiGupta
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

Re: Telnet

PostPosted: Mon Dec 05, 2016 7:23 pm
by Tim
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

Re: Telnet

PostPosted: Tue Dec 06, 2016 5:49 am
by AshiGupta
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.

Re: Telnet

PostPosted: Tue Dec 06, 2016 6:27 pm
by Tim
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

Re: Telnet

PostPosted: Wed Dec 07, 2016 6:19 am
by AshiGupta
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