- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: rcp, rlogin ... without password prompt
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2005 12:54 AM
тАО02-28-2005 12:54 AM
I've edited the .rhosts file, and used SAM (Networking and Communication > System Access > Remote Logins), to allow me to use rlogin without being prompted for the password. For .rhosts, I put the remote and local system name and the user root. Same settings I tried from SAM, but still I'm prompted for password.
Initially, if I rlogin to myslef, I was prompted for password, but with same settings as for other systems I was able to get rid of the prompt.
The need for not being prompted is actually to use rcp. Is there any option or workaround that allows us to feed the password to rcp command.
Really appreciate any assistance
Thanks and Regards,
-Alvi
Solved! Go to Solution.
- Tags:
- .rhosts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2005 01:01 AM
тАО02-28-2005 01:01 AM
Re: rcp, rlogin ... without password prompt
What is the HOME for root?
grep root /etc/passwd | head | cut -d":" -f6
What are the contents of the root_HOME/.rhosts ?
It should be:
remotehostname root
You don't need to do anything special on the remotehost, other than actually being root to initiate the rcp.
live free or die
harry d brown jr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2005 01:07 AM
тАО02-28-2005 01:07 AM
Re: rcp, rlogin ... without password prompt
You might wish to consider using Secure shell for the same functionality without the serious security implications of the r protocols.
http://software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2005 01:20 AM
тАО02-28-2005 01:20 AM
Re: rcp, rlogin ... without password prompt
It should only be readable by the user, in your case root. (mode 600 or even 400, or -rw-------)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2005 01:23 AM
тАО02-28-2005 01:23 AM
Re: rcp, rlogin ... without password prompt
I've tried two combinations on both systems for .rhosts
systemname root
&
systemname
As for sam, I noticed that when I give login priviledges to the super user, and the option of not being prompted for password, the /.rhosts file is modified with only the system name added on a single line.
But I still get the password prompt.
-Alvi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2005 01:30 AM
тАО02-28-2005 01:30 AM
Re: rcp, rlogin ... without password prompt
Are you rlogin'ing from another Hp system?
What about /etc/hosts.equiv??
live free or die
harry d brown jr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2005 02:11 AM
тАО02-28-2005 02:11 AM
Re: rcp, rlogin ... without password prompt
Confirm if /var/adm/inetd.sec file is not present on the server where you want to enable rlogin. If it is present All remote Service requests will be verified from this file. If this file is present for your rlogin you should define
login allow RLOGIN_CLIENT_IP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-01-2005 03:51 AM
тАО03-01-2005 03:51 AM
Re: rcp, rlogin ... without password prompt
Also check for the /etc/securetty file. If this file is present, and has the word 'console' in it, you will not be able to remotely log into that host as root. You will be able to log in as a regular user, then su to root, but will not be able to directly log in as root remotely.
Regards,
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-01-2005 05:05 AM
тАО03-01-2005 05:05 AM
Re: rcp, rlogin ... without password prompt
As far as where to put the file, it must reside in $HOME. NOTE: I did not say / or anything else. When you login, the value for $HOME is set (from the passwd file) to the correct location so you edit the file $HOME/.rhosts and it will be in the current user's home directory. / happens to be the default for root although it is a very bad default and should be changed.
.rhosts must be 600 permissions, owned by the user. So for root, .rhosts would be rw------- and owned by root. To test that remsh/rcp/rlogin all work without a password request, just ermove all lines in .rhosts and put in the single character: + which means: anyone from any system can use rcp/remsh/rlogin without a password.
Having said that, it is a VERY bad idea to have .rhosts for root. While it makes system maintenance easier, the possibility for a security breach is guarenteed. Consider reading up on ssh as a replacement for the "r" commands.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-01-2005 04:30 PM
тАО03-01-2005 04:30 PM
Re: rcp, rlogin ... without password prompt
Finally the problem's been resolved.
I had the .rhosts configured properly, even sam made the since configuration
hostname root
Both my systems have 3 network interface cards; however etc hosts had only one entry for the remote system and three for itself. Once I modified etc/hosts on both systems to reflect all NICs, the password issue disappeared.
A few other pointers I learnt on the way
- $HOME/.rhosts is used to give super user access
- /etc/hosts.equiv is used for all other users.
- /etc/cmclnodlist can also substitute for $HOME/.rhosts
- /var/adm/inetd.sec .... what role does this have, while residing in var?
- Is there any good manual for ssh, i've downloaded and now i'll investigate
- Whats wrong with having rott's home @ /?
be assigning points soon.
Thanks a lot.
Regards,
-Alvi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2005 12:38 AM
тАО03-02-2005 12:38 AM
Solution> $HOME/.rhosts is used to give super user access
True, but incomplete. Each user has their own home directory (to which the HOME variable is set) so the statement should read:
$HOME/.rhosts is used to give users on other systems access to the local system
> /etc/hosts.equiv is used for all other users.
/etc/hosts.equiv can indeed give users on other systems access to the local system but it is not the only method (see above). NOTE: hosts.equiv can be a serious security risk.
> /var/adm/inetd.sec
This file is service filter to allow or disallow certain IP addresses from accessing your local system. Although it resides in /var (for historical reasons), it is indeed a system-wide configuration file. Suppose you only want certain machines to access your system through telnet. You would then allow only those specific addresses (or range of addresses) to get through by editing inetd.sec. The man page for inetd.sec is very helpful.
> Is there any good manual for ssh?
The O'Reilley book for ssh is a good reference: http://www.oreilly.com/catalog/sshtdg/
although there are numerous quick reference docs posted here in the forums. I've attached Chris Vail's quick reference for SHH.
> Whats wrong with having root's home @ /?
/ is THE most dangerous directory in the system. If this is root's home directory, the most dangerous commands will destroy the entire system, requiring a complete re-installation. The most dangerous commands in Unix:
rm -r
mv
cp
chmod -R
chown -R
(there other dangerous commands that are not sensitive to the filesystem structures like dd and mediainit) So why is / very bad as root's HOME? Consider this fairly common mistake:
cd /temp
rm -rf *
If root just logged in, the computer is now being destroyed. The reason? The directory name is misspelled (/temp should have been /tmp) and the superuser forgot to look for a warning message (sh: /temp: not found.) after the cd command. The rm -rf will silently remove *EVERY* directory and file on the entire computer (or at least until HP-UX crashes) and if bad permissions were given to access NFS-mounted directories, the command will also destroy files and directories on remote computers. Only your CDROM is safe.
cd is often overused by root. Root is too powerful for casual use so if you need to remove a directory, *always* use a fullpath. Repeat: always use a fullpath. In the above example, changing the rm command from
rm -rf *
to
rm -rf /temp/*
would have done nothing and reported an error message. Similarly, a common sysadmin mistake is not understanding pattern matching and regular expressions. For example, to remove a user's files, novice sysadmins might do this:
cd /home/billh
rm -rf *
But then find out that .profile and other . files are still there. So they will issue this command:
rm -rf .*
Again, a major mistake. .* says: match all files and directories that start with . and have ZERO or more characters following. No problem with .profile, .sh_history and so on, but as an exercise, try this command in your $HOME directory:
echo .*
The first two filenames that are matched will be . and .. which is a big surprise to a newbie sysadmin. Yes, .. is a real directory and it happens to be the parent, in this case, /home. So the rm command will start recursively removing every directory and file in .. (/home) thus destroying all the user files. This isn't nearly as bad as / but certainly not a nice way to start the day. Whenever I am about to use a recursive rm (or mv, cp) command, I'll put echo in front to see exactly what the shell sees:
echo rm .*
Hint: you can avoid . and .. directories by using [!.] which is a character class to exclude (not match) the . as a character string. Try this:
echo .*
echo .[!.]*
and you'll see the . and .. directories disappear from the list. Of course, there are always obscure exceptions, in this case, any file or directory that starts with 2 dots (ie, ... or ..abc) will be missed. But that's a small consequence to the possibility of removing every user's HOME directory.
I ALWAYS alias the 3 commands for file destruction to have the -i option in root's .profile:
alias rm="/usr/bin/rm -i"
alias mv="/usr/bin/mv -i"
alias cp="/usr/bin/cp -i"
So the first thing that a sysadmin will do in setting up a new system, even before adding patches and applications, is to move root's HOME. Don't worry, HP-UX is not alone with this setup--many other flavors of Unix have the same default HOME for root and they all need to be fixed to control the "oops" factor. The most common technique is:
umask 077
mkdir /root
vipw
The command vipw is the recommended editing method for changing the passwd file. Not only does it save a lot of keystrokes (vipw versus vi /etc/passwd) but it creates a lockfile so another root user won't accidently edit the same file. In vi, change the second to last field from :/: to :/root: and then save the result. While leaving a root login window open, try logging in as root in another window. If all is well, you can type pwd in the current window and you'll see /root. Now you can move all files (not directories) into /root. NOTE: Some bad applications may require ordinary files in / so make sure you know if there are such files in /. Naturally, you can always move them back from /root to / if necessary.
All good questions. I'll be covering a lot of these techniques March 22 in Amsterdam (actually, the HP office in Amstelveen).
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2005 03:14 AM
тАО08-23-2005 03:14 AM