Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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?
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.
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!!!!!!!!!!!!
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.
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!!!!!
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.
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!
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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.