LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-25-2001, 02:34 PM   #1
Rex_chaos
Member
 
Registered: Aug 2001
Location: GD, GZ, China
Posts: 240

Rep: Reputation: 30
Remote login


Hello all,
I have two computers connected to each other. And each one has installed linux. How can I login one of them with rsh. What files should I make configuation and how?
 
Old 09-25-2001, 03:19 PM   #2
d3funct
Member
 
Registered: Jun 2001
Location: Centralia, WA
Posts: 274

Rep: Reputation: 31
you will need a .rhosts file in your home directory and it should be mode 600 (rw-------) using the chmod command. It should look like this:
hostname username where "hostname" is the name of the computer your coming from and the username is the user who is doing the rsh/rcp/rexec. BE CAREFUL with this as it could be a major security hole.
 
Old 09-25-2001, 08:12 PM   #3
Rex_chaos
Member
 
Registered: Aug 2001
Location: GD, GZ, China
Posts: 240

Original Poster
Rep: Reputation: 30
I don't really understand the process. Take a example,
If I have two computer connected to each other. Let's the first one's ip be 202.116.5.50 and a user named A, another one's ip is 202.116.5.51 and a user named B. If I want to login 202.116.5.51 from 202.116.5.50 , should I have the .rhosts file on the home dir of 202.116.5.51 with the content of:
202.116.5.50 A

I wonder if A should be the computer name of 202.116.5.50 or a username. Which side should the .rhosts file reside?
 
Old 09-25-2001, 09:23 PM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
You should ude ssh
 
Old 09-26-2001, 09:42 AM   #5
Rex_chaos
Member
 
Registered: Aug 2001
Location: GD, GZ, China
Posts: 240

Original Poster
Rep: Reputation: 30
How to use ssh? Can you give me an example? Thx
 
Old 09-26-2001, 10:10 AM   #6
d3funct
Member
 
Registered: Jun 2001
Location: Centralia, WA
Posts: 274

Rep: Reputation: 31
From the SSH man page:

First, if the machine the user logs in from is listed in /etc/hosts.equiv
or /etc/ssh/shosts.equiv on the remote machine, and the user names are
the same on both sides, the user is immediately permitted to log in.
Second, if .rhosts or .shosts exists in the user's home directory on the
remote machine and contains a line containing the name of the client ma*
chine and the name of the user on that machine, the user is permitted to
log in. This form of authentication alone is normally not allowed by the
server because it is not secure.

The second (and primary) authentication method is the rhosts or
hosts.equiv method combined with RSA-based host authentication. It means
that if the login would be permitted by $HOME/.rhosts, $HOME/.shosts,
/etc/hosts.equiv, or /etc/ssh/shosts.equiv, and if additionally the serv*
er can verify the client's host key (see /etc/ssh/ssh_known_hosts and
$HOME/.ssh/known_hosts in the FILES section), only then login is permit*
ted. This authentication method closes security holes due to IP spoof*
ing, DNS spoofing and routing spoofing. [Note to the administrator:
/etc/hosts.equiv, $HOME/.rhosts, and the rlogin/rsh protocol in general,
are inherently insecure and should be disabled if security is desired.]


The syntax for SSH is ssh [-l login_name] [hostname | user@hostname] [command]

Secure Shell also has scp (secure copy), sftp (secure ftp), slogin (secure remote login) and others. Check out the SSH Homepage for documentation and examples.
 
Old 09-27-2001, 09:20 AM   #7
Rex_chaos
Member
 
Registered: Aug 2001
Location: GD, GZ, China
Posts: 240

Original Poster
Rep: Reputation: 30
Hello all,
I really want to login a remote mechain use rsh, tho I know it's not safe to do that. I have two computer installed linux.
Let's call the first one A and the other one B. And give the following conditions:

computer ip user as
A 202.116.5.30 Rex Server
B 202.116.5.31 Rex Client

In server(A) side, the /etc/hosts contains:
202.116.5.31

and $HOME/.rhosts contains
202.116.5.31

when I use rsh to login A from B, it reports
202.116.5.31: Connection refused

I success to ping the host A, I don't know what's wrong?

I want to use ssh instead rsh, but error still occur..........!!!!!!!!!
Please help, it's very urgent!!!!!!!!!!!!
 
Old 09-27-2001, 01:50 PM   #8
d3funct
Member
 
Registered: Jun 2001
Location: Centralia, WA
Posts: 274

Rep: Reputation: 31
Account-level equivalence uses a file called .rhosts in the home directory of the target account. Each line of .rhosts consists of hostname and, optionally, a list of usernames:

hostname username

Each line means that username is allowed to login to this account from hostname. If username is not present, then only the same username as the owner of the .rhosts file can login from hostname.

For example, consider the following .rhosts file in the home directory of a user named john:

england guy donald
russia felix
usa felix
china kim


The .rhosts allows the user felix to login from the hosts russia or usa, and users named guy and donald to login from only england and kim from china.

If remote access is attempted and the access does not pass the host level equivalence test (in otherwords the hostname is not in /etc/hosts.equiv) the remote host then checks the .rhosts file in the home directory of the target account (john in this case). If it finds the hostname and username of the person making the attempted access, he remote host allows the access to take place without requiring the user to enter a password.

WARNING: Account level equivalence should NEVER be used for the superuser (root) account. Passwords should always be required to gain access to root accounts. There should be no .rhosts file in the root directory.

Once you can successfully login using rlogin you have proven that your .rhosts file works and can now use the other commands rsh, rcp and rexec.

IMPORTANT: The .rhosts file should only be readable and writable by the owner!
Once you create the .rhosts file run "chmod 600 .rhosts" to ensure this.

Hope this helps you.
 
Old 09-28-2001, 01:06 AM   #9
Rex_chaos
Member
 
Registered: Aug 2001
Location: GD, GZ, China
Posts: 240

Original Poster
Rep: Reputation: 30
Error again!

I wonder if I must write the hosts name in .rhosts file with domain-name format.

Is is not valid if I use rsh command with the actual ip as the host parameter?

How can I ping the other machine using the domain name as the host parameter? I can ping myself using the domain as the host parameter, but it fail to ping the remote machine with the domain name as the host parameter, why?

I have tried to set the .rhosts file containing: + +
(I know it means any machines and any users can access the machine where the .rhosts file located. ) Unfortunately, 'Connection refused' ocurred again!!!!!

Can I use rsh or rlogin to login myself?


Please help! Please help! Please help!
Please help! Please help! Please help!
 
Old 09-28-2001, 01:52 PM   #10
d3funct
Member
 
Registered: Jun 2001
Location: Centralia, WA
Posts: 274

Rep: Reputation: 31
Well, I suppose you could use IP addresses instead of hostnames. The reason hostnames are used is because IP addresses can change without notice sometimes. Try it with IP's instead can't hurt. As far as there being anything else to do, I've given you all the steps there are to setting up rsh/rcp/rexec/rlogin. Check your /etc/resolv.conf to see if your DNS is setup properly, and /etc/hosts to make sure the hosts your trying to connect to are defined.
 
Old 09-28-2001, 07:39 PM   #11
Rex_chaos
Member
 
Registered: Aug 2001
Location: GD, GZ, China
Posts: 240

Original Poster
Rep: Reputation: 30
rsh daemon!

Someone tells me the error occurrs for I do not have the rsh daemon (rshd) running . What's rsh daemon? How can I make it running? Should I install anything from some package first? Thanks!
 
Old 09-28-2001, 07:55 PM   #12
d3funct
Member
 
Registered: Jun 2001
Location: Centralia, WA
Posts: 274

Rep: Reputation: 31
The rsh daemon (rshd) only runs when someone is actually rsh'ing. So first verify that your rsh service will start:
If you are using Redhat 7.1 go to /etc/xinetd.d and you should see some files beginning with the letter 'r' (rsh,rlogin,rsync), edit these files and where it says "disable=yes" change it to "disable=no". Then as root type "/etc/rc.d/init.d/xinetd start" and that will restart your system services. Then type "pgrep rsh" to see if rsh is running, if it returns a process id (PID) number it's running.

If you're running Redhat 7.0 or lower edit the /etc/inetd file and where you see a poundsign (#) before any of those services remove the pound sign (called "uncommenting"). Then as root type "ps -ef |grep inetd" this will show you the PID of the inetd process. Now type "kill -HUP {the pid of inetd}".

Now try rsh'ing and it should go.
If you have any other problems, I'll be checking this thread.
 
Old 09-28-2001, 10:23 PM   #13
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
If you are using iptables this should allow ssh to work

$IPTABLES -A tcp_packets -p TCP -s 0/0 --dport 22 -j allowed

also /etc/services needs these lines

ssh 22/tcp # SSH Remote Login Protocol
ssh 22/udp # SSH Remote Login Protocol



SSH has replaced rsh, rlogin, and others as the more secure choice and there is no reason it should not work unless the firewall is blocking it, if you are logging on with the correct user name and password.

If you only want to access it from a certain machine you can put it's ip address in the place of 0/0 in the -s (source ip) option.

Last edited by DavidPhillips; 09-28-2001 at 10:27 PM.
 
Old 12-02-2003, 06:44 AM   #14
samik_ban
LQ Newbie
 
Registered: Jul 2003
Posts: 12

Rep: Reputation: 0
Stuck with Remote Login

I have gone through the entire process.
Can any one just write up the steps to be followed.
Consider the ip's as above to be
202.116.5.30 with user A
202.116.5.31 with user B
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote login help! Braveheart1980 Linux - General 4 08-26-2005 04:04 AM
remote login with X walterbyrd Linux - Networking 1 07-21-2005 11:21 PM
remote x login instead of local login mandrake-n00b Mandriva 0 04-22-2005 09:19 PM
Remote Login SBFree Linux - Newbie 7 11-15-2004 05:14 PM
remote login BRAHmS Linux - Networking 2 06-14-2004 02:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:30 AM.

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
Open Source Consulting | Domain Registration