LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-18-2015, 04:26 AM   #1
Selecta
LQ Newbie
 
Registered: Sep 2015
Distribution: Ubuntu 14.04
Posts: 19

Rep: Reputation: Disabled
Question Run application when user connects with telnet


When I user connects to my telnet server I want it to run an application rather than drop him to a command line.

How might I do that?

Thank you!
 
Old 09-18-2015, 04:37 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
A couple of options:

1. call your app as part of the login process (user's bash_profile)

2. Make your app network aware and attach it to the telnet port instead of the telnet server.
 
Old 09-18-2015, 04:41 AM   #3
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian Sid. Arch. In the process of converting to and learning FreeBSD
Posts: 1,023
Blog Entries: 6

Rep: Reputation: 237Reputation: 237Reputation: 237
3. You may also set the application as the user's login shell.
 
Old 09-18-2015, 04:45 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Actually, that's better than my num 1.
 
Old 09-18-2015, 02:41 PM   #5
Selecta
LQ Newbie
 
Registered: Sep 2015
Distribution: Ubuntu 14.04
Posts: 19

Original Poster
Rep: Reputation: Disabled
I added the run command to the bottom of my .bashrc and that worked like a charm. Next I would like the telnet session to disconnect when the application exits. Is that possible?

Thank you!
 
Old 09-18-2015, 02:52 PM   #6
hortageno
Member
 
Registered: Aug 2015
Distribution: Ubuntu 14.04 LTS
Posts: 230

Rep: Reputation: 65
Quote:
Originally Posted by Selecta View Post
I added the run command to the bottom of my .bashrc and that worked like a charm. Next I would like the telnet session to disconnect when the application exits. Is that possible?

Thank you!
See post #3.
 
Old 09-18-2015, 04:25 PM   #7
Selecta
LQ Newbie
 
Registered: Sep 2015
Distribution: Ubuntu 14.04
Posts: 19

Original Poster
Rep: Reputation: Disabled
I got it. I just put exit after the application start line in the .bashrc and I'm good to go.
 
Old 09-19-2015, 09:48 AM   #8
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,602

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by Selecta View Post
I got it. I just put exit after the application start line in the .bashrc and I'm good to go.
Doesn't work if the user uses control C to interrupt it.

That is why making the users shell the program works better.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
have a startup application run as a different user hafio Red Hat 1 02-23-2008 10:09 PM
Force an application to run only for my user purefan General 1 04-12-2005 10:30 AM
Run an application under a user on startup? wichmann_uwe Linux - General 1 01-23-2004 04:07 AM
telnet to port 25 connects but without reply? Pcghost Linux - Networking 13 01-19-2004 11:03 PM
telnet connects but login prompt does not appear jhess Linux - Software 2 10-10-2003 07:05 AM


All times are GMT -5. The time now is 06:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration