Sponsored Content
Full Discussion: rlogin/rsh incoming port
Top Forums Programming rlogin/rsh incoming port Post 54502 by andryk on Tuesday 17th of August 2004 04:13:10 AM
Old 08-17-2004
rlogin/rsh incoming port

Hi all,

In need to know why my sample code below that connect to a rlogind (513) fails, but original unix rlogin does not ? (.rhosts is verified to be correct)

I heard rlogin/rsh bind to a reserved port before connecting to the rlogin server. what are they ???

Code:
   s = socket(AF_INET, SOCK_STREAM, 0);
   sck.sin_family      = AF_INET;
   sck.sin_port        = htons(513);
   sck.sin_addr.s_addr = inet_addr("192.168.15.40");

   if (connect(s, (struct sockaddr *)&sck,sizeof(sck)) <0) {
      printf("connect() error\n"); return;
   }
   printf("Connected %d\n",s);
   write(s,"",1);
   write(s,"root",5);
   write(s,"root",5);
   write(s,"linux/38400",12);

   read(s,buf,sizeof(buf));
   printf("%s\n",buf);

Any help would be appreciated Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

rsh & rlogin

I'm trying to execute the next command: " rsh CompName date " which means i want to get the date from a machine which i have its CompName. but i get the answer : "Connection refused" what do i need to do ? how can i sign myself as user or guest in the other machine ? thanks in... (2 Replies)
Discussion started by: Inbal
2 Replies

2. Shell Programming and Scripting

Listening on port for incoming data?

I am not what I would call an experienced programmer. I know some ksh etc.. I need to be able to listening on a port for incoming data on a ultra 10 using solaris 9. Basically all that I need to do at the moment is to log the incoming data on a specific port number. Any ideas on how I... (6 Replies)
Discussion started by: frustrated1
6 Replies

3. Shell Programming and Scripting

ftp, rlogin , rcp, rsh are not wroking

Hi Friends I am facing one problem, I am not able to use ftp, rlogin , rcp, rsh in a particular server. when I am trying to ftp certain file from that server it is giving Connection closed by remote host. Now from other unix box I am not able to rlogin that particular server. as .rhosts... (3 Replies)
Discussion started by: itsjoy2u
3 Replies

4. IP Networking

handling incoming messages

I have a few clients connecting to the server(which is using select()) and theyre trying to send messages to each other. How do I wait for input on stdin and at the same time I wait for data to being sent from the server? Should I use select() in my client too? How exactly though? (1 Reply)
Discussion started by: charlitos
1 Replies

5. UNIX for Dummies Questions & Answers

RSH/rlogin problem

Hello, When I try and RSH/RLOGIN onto a box with user root, I get the prompt but the username/password combination NEVER work. I have the password up properly on the host machine. Does rsh/rlogin not make use of ./etc/passwd and /etc/shadow? (1 Reply)
Discussion started by: mojoman
1 Replies

6. Linux

incoming mails not coming

I am using Linux box. i am able to send mails through sendmail to local and other domains. i am not receving any incoming mails. dovecot service is running. (4 Replies)
Discussion started by: harishindn
4 Replies

7. UNIX for Advanced & Expert Users

which port for rsh

Hi, on AIX 6.1 , which port should be open for rsh commande ? When I issu the following : rsh myremoteserver -l oracle ls it hangs until I issue ctrl+c. What should I verify ? Thank you. (0 Replies)
Discussion started by: big123456
0 Replies

8. Shell Programming and Scripting

Rlogin / RSH / SSH

Hello, I am looking for a connection method in which i can connect to a remote server but I want to have only one chance to connect to the remote server (not to be asked for iuser name and password again). If I have provided a wrong password then I want the connection to broke and be routed... (1 Reply)
Discussion started by: LiorAmitai
1 Replies

9. AIX

Deny rsh,tn,or rlogin

Is there a way to deny access to a specific remote login option. example: usera--deny telnet access but keep rsh and rlogin userb--keeps telnet, rsh, and rlogin I'm basically trying to contol the access per services instead of changing the LOGIN REMOTELY(rsh,tn,rlogin) option to yes or no. (12 Replies)
Discussion started by: leemalloy
12 Replies

10. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies
RLOGIN(1)						    BSD General Commands Manual 						 RLOGIN(1)

NAME
rlogin -- remote login SYNOPSIS
rlogin [-8EKLd] [-e char] [-i identity] [-l username] [-p port] host DESCRIPTION
Rlogin starts a terminal session on a remote host host. Rlogin first attempts to use the Kerberos authorization mechanism, described below. If the remote host does not supporting Kerberos the standard Berkeley rhosts authorization mechanism is used. The options are as follows: -8 The -8 option allows an eight-bit input data path at all times; otherwise parity bits are stripped except when the remote side's stop and start characters are other than ^S/^Q . -i The -i option specifies the local user name to use for authentication with the remote rlogind server. This overrides the default which is the name of the user invoking rlogin. -l The -l option specifies the name of the remote user to login as. This overrides the default which is the name of the user invoking rlogin. -E The -E option stops any character from being recognized as an escape character. When used with the -8 option, this provides a com- pletely transparent connection. -K The -K option turns off all Kerberos authentication. This option has no effect since Kerberos authentication is not available in this version. -L The -L option allows the rlogin session to be run in ``litout'' (see tty(4)) mode. -d The -d option turns on socket debugging (see setsockopt(2)) on the TCP sockets used for communication with the remote host. -e The -e option allows user specification of the escape character, which is ``~'' by default. This specification may be as a literal character, or as an octal value in the form nn. -p The -p option specifies the port to connect to. This overrides the default which is login. A line of the form ``<escape char>.'' disconnects from the remote host. Similarly, the line ``<escape char>^Z'' will suspend the rlogin ses- sion, and ``<escape char><delayed-suspend char>'' suspends the send portion of the rlogin, but allows output from the remote system. By default, the tilde (``~'') character is the escape character, and normally control-Y (``^Y'') is the delayed-suspend character. All echoing takes place at the remote site, so that (except for delays) the rlogin is transparent. Flow control via ^S/^Q and flushing of input and output on interrupts are handled properly. ENVIRONMENT
The following environment variable is utilized by rlogin: TERM Determines the user's terminal type. SEE ALSO
rsh(1) HISTORY
The rlogin command appeared in 4.2BSD. BUGS
Rlogin will be replaced by telnet(1) in the near future. More of the environment should be propagated. Linux NetKit (0.17) August 15, 1999 Linux NetKit (0.17)
All times are GMT -4. The time now is 11:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy