- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- telnet in a script
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
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
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
03-08-2004 09:04 PM
03-08-2004 09:04 PM
is it possible to create a script with telnet included and bypass the password request?
Have you ever created a similar script? Have you experiencies about this?
Thanks in advance for your helps!
Kind regards,
Pedro
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2004 09:15 PM
03-08-2004 09:15 PM
Re: telnet in a script
Take a look at the man page for remsh. With the use of /.rhosts or /etc/hosts.equiv you can log in and run remote commands without the need for a password.
To do this as root, on the server (server1) add .rhosts with an entry like
client1 root
Permissions should be r only for root so
chmod 400 /.rhosts
On client1
#remsh server1 -l root -n "ls -l /.rhosts"
-r-------- 1 root sys 42 Mar 5 16:45 /.rhosts
Regards,
Dave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2004 09:15 PM
03-08-2004 09:15 PM
Re: telnet in a script
However commands starting with letter r (rlogin, rcp, remsh) can be used on a network using /etc/hosts.equiv or .rhosts file.
There are security issues which need to looked into before doing this.
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2004 09:16 PM
03-08-2004 09:16 PM
Re: telnet in a script
Yes it is possible with expect. Refer to my earlier thread on this topic,
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=45609
Regards,
KarthiK S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2004 09:28 PM
03-08-2004 09:28 PM
Re: telnet in a script
I am looking for...
Kind regards,
Pedro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2004 09:32 PM
03-08-2004 09:32 PM
Re: telnet in a script
To set it up, change the telnetd line in /etc/inetd.conf to read
telnet stream tcp nowait root /usr/lbin/telnetd telnetd -t
then restart inetd (inetd -c)
This then enables telnet sessions to use standard equavalency via the hosts.equiv file.
The security issue with this is that it connects to the remote server using the UID number, rather than the user name.
eg: you have 2 servers server1 and server2. On server1, userA has UID number 123 and userB has UID 456, on server2, userB has UID number 123, and userA has UID 456
If TAC is enabled, when userA issues the telnet command to connect from server1 to server2, they actually log in to server2 as userB, even though the ID userA exists
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2004 06:10 AM
03-09-2004 06:10 AM
SolutionREMOTE=A.B.C.D
(sleep 5
echo "\r"
sleep 1
echo "login\r"
sleep 1
echo "password\r"
sleep 3
echo "ethernet portState 2 disable\r"
sleep 1
echo "ethernet portState 1 enable\r"
sleep 1
echo "ethernet sum all\r"
sleep 2
echo "q\r"
sleep 1
echo "logout\r"
echo "\r") |telnet $REMOTE
Ron