Telnet revoked


 
Thread Tools Search this Thread
Operating Systems Solaris Telnet revoked
# 1  
Old 07-28-2008
Telnet revoked

Hello,

We were using telnet as in the below script to allow a different user execute the below scripts.We dont want the user to know our uid/pwd.However telnet was revoked by our admins and we are no more able to use this piece of script.

else
{
echo "user1"
sleep 2
echo "pwd"
sleep 2
echo "cd /apps/scripts"
sleep 2
echo $COMMAND1
sleep 5
} | telnet localhost

Is there a way to replace this with a diff piece of scripts say using ssh.Please note that this script will be owned by "user1" and used by a diff user who will neither be able to see the script nor know the password for user1.
# 2  
Old 07-28-2008
If the user running this can't see the script, they can't run it.
But to use ssh in the same way you are currently using telnet, you can just change 'telnet to 'ssh' safely enough.

That code fragment looks really strange to me though, I suspect ther'll be an easier way to do what you are trying to achieve there...
# 3  
Old 07-28-2008
The script is there in place for some historic reasons Smilie

By "see" I mean they should not be able to view the contents of the script.When I change from 'telnet' to 'ssh' , the script echoes the userid and pwd which is not desired.

If there is a more simpler way to do this I am more than happy to do it that way.......

Thanks in advance for your help.
# 4  
Old 07-28-2008
Take out those lines, they were for logging in using the telnet command, but ssh with a suitable key will not require a password.

Simpler still;

Code:
ssh user1@localhost "cd /apps/scripts; $COMMAND1"

Even simpler would be sudo or su but that again requires the user to type in a password. With sudo you can set it up so that no password is required, though.
# 5  
Old 07-31-2008
ssh user1@localhost "cd /apps/scripts; $COMMAND1"

user1 will be already logged into the user.But only user2 has the privilege to execute the command.

Hence I need to pass the password in the script.Any help.

ssh user2@localhost "cd /apps/scripts; $COMMAND1" somehow i need to pass password.

Only user2 can execute the command and user1 cannot.user1 will execute only the script.
# 6  
Old 08-01-2008
Then, plant in your authorized key..
# 7  
Old 08-01-2008
How can this be passed instead of prompting for the password?

Thanks in advance.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Telnet

Hi, Need some help on exiting the telnet session from the script. #!/bin/ksh telnet <ip> it would print some text and it would ask for a username and pwd. I jus need to capture the text and i need to come out of the telnet session. is it possible without expect ? (6 Replies)
Discussion started by: giri_luck
6 Replies

2. UNIX for Dummies Questions & Answers

Difference Between Krb5-telnet And Ekrb5-telnet

Hi, I want to know the difference between these two services. Both are under xinetd. Both are used for enabling and disabling Telnet service. So, can somebody please explain me the difference between the two ? Thanks in advance :) (0 Replies)
Discussion started by: kashifsd17
0 Replies

3. UNIX for Dummies Questions & Answers

Automatically login in the telnet from present telnet

Hi, I was writing one script which includes to switch to the another telnet automatically from the present telnet server. I was using rlogin but firstly it takes the same user name of the present telnet and secondly it is prompting for the password. But i want to switch to the another telnet... (2 Replies)
Discussion started by: Prateek
2 Replies

4. UNIX for Dummies Questions & Answers

Display revoked users?

Hello, Is there a way on unix to see if a userid is suspended or revoked? I have an I.D but when I try to use it it keeps saying Sorry! (3 Replies)
Discussion started by: Grueben
3 Replies

5. Solaris

TELNET

Hi Friend, In my solaris 7 machine, I m able to ping the server. But i m not able to access from telnet, ssh. wht may be the reason ? I already checked /etc/default/login /etc/sshd/ssh_config for ssh. thnx in advance. :rolleyes: (6 Replies)
Discussion started by: rajaramrnb
6 Replies

6. Shell Programming and Scripting

Webpage to Telnet via Perl and Expect: Telnet problem?

Somewhat long story: I have a simple Perl CGI script that uses Expect to Telnet to a device and grab some data, and then spits it back to Perl for display on the Webpage. This works for many devices I've tried, but one device just fails, it keeps rejecting the password on this device, only... (1 Reply)
Discussion started by: jondo
1 Replies

7. AIX

Telnet and su -

I have some AIX 4.3 machines which have disabled root telnet access. When you run su - once logged on the machine requests a password and if one is supplied correctly it asks for another users password. How do I configure this? Any help is appreciated. Thank you (0 Replies)
Discussion started by: uXion
0 Replies

8. UNIX for Advanced & Expert Users

Telnet

Hi, When we use telnet (from unix workstation or windows) to remotely access the Unix server, the environment variables such as: DISPLAY, TERM, LOGNAME are communicate to the telnet server during the telnet session negotiation. By default these variables are passed to the server. We can... (1 Reply)
Discussion started by: vtran4270
1 Replies

9. UNIX for Advanced & Expert Users

telnet

Hi All, I have written a script called findwho.sh findwho.sh in Development Server ======== who -M>x I want to copy the file findwho.sh into Production Server and run this script on it then output file x copy back to the Development Server 1) Every time ftp findwho.sh to... (4 Replies)
Discussion started by: krishna
4 Replies
Login or Register to Ask a Question