Click to See Complete Forum and Search --> : Need to make a script and put on desktop.
npereira
10-23-2002, 03:22 PM
I need to make a script that will execute this command;
- aterm -e telnet kan142
then wait for 'username' and enter;
- my_username
then wait for 'password' and enter;
- my_password
How can I do this? I want the script on my desktop (gnome) so I know I have to put the executable file in .gnome-desktop/[name_of_script]
Please help.
rbermejo
10-23-2002, 04:50 PM
1.-Create/edit a file in your home dir called .netrc in that way:
machine "kan142" login your_login_here password your_password_here
Then change its permissions : chmod 400 .netrc (just read for you)
2.-In a script:
xterm -e rlogin kan142 -l your_login
3.-Place the script:
You can put it in your desktop or in the panel (i think is better):
PANEL>ADD to PANEL>>LAUNCHER
Then:
On the Command field "rlogin kan142 -l your_login"
and choose 'Run in Terminal'
The .netrc file works as the key holder.
Have fun!
npereira
10-23-2002, 06:23 PM
Originally posted by rbermejo
1.-Create/edit a file in your home dir called .netrc in that way:
machine "kan142" login your_login_here password your_password_here
Then change its permissions : chmod 400 .netrc (just read for you)
2.-In a script:
xterm -e rlogin kan142 -l your_login
3.-Place the script:
You can put it in your desktop or in the panel (i think is better):
PANEL>ADD to PANEL>>LAUNCHER
Then:
On the Command field "rlogin kan142 -l your_login"
and choose 'Run in Terminal'
The .netrc file works as the key holder.
Have fun!
I'm confused. What exactly goes in the .netrc and what is the file name for your #2?
rbermejo
10-23-2002, 07:18 PM
.netrc:
suppose your login is 'npereira' and your password 'noise44' then the .netrc should be like this :
machine "kan142" login npereira password noise44
#2:
You can use the name you want for you script, just put the code below in a text file, name it as you want and make it executable 'chmod +x myname'
xterm -e rlogin kan142 -l your_login
bwkaz
10-23-2002, 09:27 PM
Or, since rlogin, rsh, and all of the r-services in fact, are inherently insecure (they send your password without encrypting it, for one), you can use ssh instead, as long as the remote computer is running sshd. Make sure there's an "identity.pub" file in your ~/.ssh directory (if it doesn't exist, you can use ssh-keygen to generate it, but don't put a password on it), and then copy it over to the remote computer. Put it in your ~/.ssh directory on that end, and name it authorized_keys instead of identity.pub. Once you do that, you should be able to log into that machine using ssh without a password. Then your remote login script is as simple as ssh remote_computer_name -l user_name (but you don't need the -l user_name (that's a lowercase ell, by the way) part if your username is the same on both machines).
npereira
10-24-2002, 08:19 AM
Originally posted by rbermejo
.netrc:
suppose your login is 'npereira' and your password 'noise44' then the .netrc should be like this :
machine "kan142" login npereira password noise44
#2:
You can use the name you want for you script, just put the code below in a text file, name it as you want and make it executable 'chmod +x myname'
xterm -e rlogin kan142 -l your_login
Ok this worked better than putting the in the pannel. Although it always asks me for the password. In fact there is a few inputs I'd like to be automatic.
when I start the script, named TRAC, it pops up an aterm session with a password prompt from the server. I then enter the password and then I need to type 'trac'. I would like the password and the 'tract' input to be automatic. How to do this?
bwkaz
10-24-2002, 10:42 AM
If you use ssh instead, you can simply ssh username@remote_computer_name tract or whatever command you want to run. Set up the authorized_keys file first though.
If you want to run things other than just tract, then there's no good way to do that. You'd have to just start up a shell, run tract or whatever, and then do what else you want.