Thread: autimating telnet process

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    1

    autimating telnet process

    situation: i would like to have the ability to automate the telnet process in unix environment so that instead of having to open a terminal and typing out all the commands, one would only have to click on an option in the context menu, enter user name and password in a pop-up box, and the connection is made, and then a program is run thereafter.

    set up: two solaris (i believe) computers on seperate lans. both are shared/multi-user computers using xwindows (or similar type of desktop gui).

    more specifics: my normal rutine (as with many of the other users) consists of opening a terminal window, telneting a specific computer, logging in, and then running a command (that is a rather long string). what i would like is to somehow have a program that would automate the process a bit. for security reasons, i'd like it to still require the user to enter the user name and pass for the telnet session, but have everything else automated.
    i am familiar with editing the context menu and writting scripts, but because i want this to run without the need of an open terminal, and because i still need user input, i'm assuming this would need to be written in a compiled language like c instead of, say, perl. also, this is a work computer on which i am not allowed to download/upload anything, but i can create files and believe i can compile programs written in c.

    if you have any information regarding this, please share. this seems like it would be a simple enough program (the more simple, the better), but as i have no experience writting in c, i'm not exactly sure.

    thank you for your help

    p.s. if this is in the wrong section, please feel free to move it, thank you.

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Are you telneting from a Unix server?
    What "context menu" are you refering to?

    Maybe you can make use of rsh, like so:
    Code:
    rsh -l username remotehost "/usr/bin/ls -al"
    
    or
    
    xterm -exec "rsh -l username remotehost /usr/bin/ls -al;read"
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    I believe ssh lets you pass the program to invoke on the other side on the command line. Thus you could put this long command into a shell script on the remote computer and set up a direct link to a special ssh call on the local one, which does nothing but invoke the script. ssh will still ask for username and password.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. init adopts zombie process?
    By password636 in forum Linux Programming
    Replies: 4
    Last Post: 07-01-2009, 10:05 AM
  2. create a child process that creates a child process
    By cus in forum Linux Programming
    Replies: 9
    Last Post: 01-13-2009, 02:14 PM
  3. Replies: 3
    Last Post: 10-15-2008, 09:24 AM
  4. Problem with forking a process
    By Unitedroad in forum C Programming
    Replies: 10
    Last Post: 10-04-2007, 01:43 AM
  5. process programming
    By St0rM-MaN in forum Linux Programming
    Replies: 2
    Last Post: 09-15-2007, 07:53 AM