Sponsored Content
Homework and Emergencies Homework & Coursework Questions How to auto telnet the server from another server? Post 302527415 by michnmi on Friday 3rd of June 2011 08:45:05 AM
Old 06-03-2011
I honestly don't understand what in the above provided solution isn't working for you...no I don't think you should do it through 'ssh' if there is no specific reason to use Secure Socket.

Telnet should (and actually does) work just fine .

I've used it for something and it is working flawlessly.

I'll give you a step-by-step walkthrough/example below and we'll take it from there...

I'll enable telnet on my computer ,create a unixforum user,give him a password, run a command-line script, login in via telnet with the unixforum user , execute a 'pwd',an 'ls', exit from telnet and then disable telnet and delete the user.

let's go!!!

Code:
michnmi@OpenSolaris:~/Documents/Scripts/Unix.comForum$ svcs -a | grep telnet
disabled       15:29:03 svc:/network/telnet:default
michnmi@OpenSolaris:~/Documents/Scripts/Unix.comForum$ svcadm enable  svc:/network/telnet:default
michnmi@OpenSolaris:~/Documents/Scripts/Unix.comForum$ svcs -a | grep telnet
online         15:29:20 svc:/network/telnet:default
michnmi@OpenSolaris:~/Documents/Scripts/Unix.comForum$ ls -l
total 3
-rwx------ 1 michnmi staff  89 2011-06-03 13:31 a.txt
-rw-r--r-- 1 michnmi staff 637 2011-06-03 13:41 my.log
michnmi@OpenSolaris:~/Documents/Scripts/Unix.comForum$ pfexec useradd -d /export/home/unixforum -m unixforum
UX: useradd: unixforum name too long.
80 blocks
michnmi@OpenSolaris:~/Documents/Scripts/Unix.comForum$ pfexec passwd unixforum
New Password: 
Re-enter new Password: 
passwd: password successfully changed for unixforum
michnmi@OpenSolaris:~/Documents/Scripts/Unix.comForum$ (sleep 1; echo "unixforum";sleep 1 ; echo "password"; sleep 2 ; echo 'pwd'; sleep 2 ; echo 'ls -la'; sleep 1) | telnet localhost
Trying ::1...
Connected to OpenSolaris.
Escape character is '^]'.
login: unixforum
Password: 
Oracle Corporation      SunOS 5.11      snv_151a        November 2010
unixforum@OpenSolaris:/export/home/unixforum$ pwd     
/export/home/unixforum
unixforum@OpenSolaris:/export/home/unixforum$ ls -la
total 11
drwxr-xr-x 2 unixforum other   8 2011-06-03 15:32 .
drwxr-xr-x 7 root      root    7 2011-06-03 15:31 ..
-rw-r--r-- 1 unixforum other 280 2011-06-03 15:31 .bashrc
-rw-r--r-- 1 unixforum other 530 2011-06-03 15:31 .profile
-rw------- 1 unixforum other  16 2011-06-03 15:32 .sh_history
-rw-r--r-- 1 unixforum other 960 2011-06-03 15:31 local.cshrc
-rw-r--r-- 1 unixforum other 988 2011-06-03 15:31 local.login
-rw-r--r-- 1 unixforum other 927 2011-06-03 15:31 local.profile
unixforum@OpenSolaris:/export/home/unixforum$ Connection to OpenSolaris closed by foreign host.
michnmi@OpenSolaris:~/Documents/Scripts/Unix.comForum$ 
michnmi@OpenSolaris:~/Documents/Scripts/Unix.comForum$ svcadm disable  svc:/network/telnet:default
michnmi@OpenSolaris:~/Documents/Scripts/Unix.comForum$ svcs -a | grep telnet
disabled       15:44:34 svc:/network/telnet:default

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sun solaris server auto reboots

Hi Guys, For the past month, our sun solaris server has rebooted itself 3 times. The sysadmin is saying that is not a sun issue and does not want to carry out any further research with sun about that. The db logfile does not show anything about any db issues at that time. I opened an oracle TAR... (3 Replies)
Discussion started by: mnjanje
3 Replies

2. Shell Programming and Scripting

Auto FTP to a server

Hi, I am trying to automate FTP login to a remote server and put a file there. But no matter what i do, It still is aksing me for the login and password although i have it defined in the variable. Could you tell me what is wrong with this script. I am doing this on SUN server. Pls... (11 Replies)
Discussion started by: systemali
11 Replies

3. Programming

Auto FTP from UNIX to Windows Server

Hi, I am a not strong programmer and now my boss ask me how should I do a job to automated FTP that have error check. I know about: * using system() to call a command to trigger ftp in C Coding. The senarios as follows: 1. FTP the file(s) (e.g ELA_20060407.dat) to a given LAN server... (1 Reply)
Discussion started by: songtam
1 Replies

4. Ubuntu

Problem to auto mount on NFS server

I am new in Ubuntu and i use Ubuntu 7.10, and have problem to mount automatic when i reboot computer, Here is my /etc/fstab 192.168.0.91:/home/DATA/it /home/USER/usertest/Documents/Z nfs defaults 0 0 I try many option in that line, but the result is same, I cannot automatic mounting the... (5 Replies)
Discussion started by: blesets
5 Replies

5. Solaris

Sun Server auto ping to 0.0.0.0

Hi All, 3 of my SAP sun server are continuosly pinging to the network address 0.0.0.0. I have no idea how this can happen, but they have something in common. All of them are clustered environment (Veritas Cluster). Anyone can help? rgds, (5 Replies)
Discussion started by: ronny_nch
5 Replies

6. Shell Programming and Scripting

How to auto telnet the server from another server using script

Hi All, I have a problem with auto telnet script, but I want to tell u something a) I am only a member access on the server, so not able to access 'root' account b) not able to install any software on server 3) On server, there is not install 'except' I have to write a script, which is ran... (0 Replies)
Discussion started by: atul9806
0 Replies

7. Homework & Coursework Questions

How to auto telnet the server from another server

Hi All, I have a problem with auto telnet script, but I want to tell u something a) I am only a member access on the server, so not able to access 'root' account b) not able to install any software on server 3) On server, there is not install 'except' 1. The problem statement, all variables... (0 Replies)
Discussion started by: atul9806
0 Replies

8. Shell Programming and Scripting

how do I infinite loop (reconnect) to auto disconnect telnet server

I want the text based Star Wars movie at towel.blinkenlights.nl to loop infinitely. It plays the movie and then disconnects my session? Can anyone think of a way to make my unix machine automatically reconnect over and over? EDIT no commands are required are the connection its just in and... (3 Replies)
Discussion started by: herot
3 Replies

9. Cybersecurity

Web Server Allows Password Auto-Completion

Hi, After running 'nessus' tool to find the Vulnerability in server OS - RHEL 5 we got " Web Server Allows Password Auto-Completion (PCI-DSS variant)" link for description provided by tools - report Nessus Plugins | Tenable Network Security I have checked - Their is only... (1 Reply)
Discussion started by: saurabh84g
1 Replies
krb5_auth_rules(5)					Standards, Environments, and Macros					krb5_auth_rules(5)

NAME
krb5_auth_rules - Overview of Kerberos V5 authorization DESCRIPTION
When a user uses kerberized versions of the ftp, rdist, rcp, rlogin, rsh, or telnet clients to connect to a server, even if the user's claimed Kerberos V5 identity is authenticated, the user is not necessarily authorized. Authentication merely proves that the user is "who he says he is" to the Kerberos V5 authentication system. Authorization also needs to be done, since it determines if that Kerberos identity is permitted to access the Solaris user account that the client wants to access. Each user may have a private authorization list in a file ~/.k5login in his login directory (on the server). Each line in this file should contain a Kerberos principal name of the form principal/instance@realm. If the server finds a ~/.k5login file, then access is granted to the account if and only if the originating user is authenticated to one of the principals named in the ~/.k5login file. If there is no ~/.k5login file, the originating user will then be checked against the gsscred table (see gsscred(1M)). If the originating user's Kerberos V5 identity is in the gsscred table, and if the UNIX user id in the gsscred table corresponds to the user account the client is trying access, then the originating user is granted access to the account on the server. If the UNIX user id does not match, then the originating user is denied access. For example, suppose the originating user has a principal name of jdb@ENG.ACME.COM and the target account is jdb-user. If jdb@ENG.ACME.COM appears in the gsscred table with uid 23154 and if jdb-user appears in the user account database (see passwd(4)) with uid 23154, then access to account jdb-user is granted. Of course, normally, the target account name in this example would be jdb and not jdb-user. Finally, if there is no ~/.k5login file and if the originating user's Kerberos V5 identity is not in the gsscred table, then the user will be granted access to the account if and only if all of the following are true: o The user part of the authenticated principal name is the same as the target account name specified by the client. o The realm part of the client and server are the same. o The target account name exists on the server. For example, if the originating user has a principal name of jdb@ENG.ACME.COM and if the server is in realm SALES.ACME.COM, then even if jdb is a valid account name on the server, the client would be denied access. This is because the realms SALES.ACME.COM and ENG.ACME.COM differ. FILES
~/.k5login Per user-account authorization file. /etc/passwd System account file. This information may also be in a directory service. See passwd(4). ATTRIBUTES
See attributes(5) for a description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
ftp(1), rcp(1), rdist(1), rlogin(1), rsh(1), telnet(1), gsscred(1M), passwd(4), attributes(5), gss_auth_rules(5) NOTES
To avoid security problems, the ~/.k5login file must be owned by the remote user. SunOS 5.10 13 Apr 2004 krb5_auth_rules(5)
All times are GMT -4. The time now is 01:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy