How to give user name and password in a single command to login to remote server
Hello All,
I'm new to unix and i need the below favour from you.
I have list of 50 unix server. I need to login to all the server one by one and with the same user and password. I will declare the user name and password globally in the script.
for example :
Using above command till now i login to server and i need to type the password manually
Trouble facing:
Before it prompts password it asking the below
After i give "yes "
then only i asking for password...
so i need this whole to automate.... Please help me
Not sure if this will work but you can give a try.
create a file say file.dat and just type "yes" and passowrd in there like:
Then pass this file to ssh command as below.
And see if login happens without propmting.
ssh has no option, for security reasons, that allow you to specify the password on the command line, or through redirection from a file. If you need a one-time only script, search this site for an expect solution. If you need to access these servers regularly, use said expect solution to distribute the key for Public Key authentication.
Make ssh-keygen .. Public and private keys.... and then u didn't need enter password for login remote host!!!!
---------- Post updated at 08:18 PM ---------- Previous update was at 08:14 PM ----------
1. Create key
Press ENTER at every prompt.
For added security '''the key itself''' would be protected using a strong ''passphrase''. If a passphrase is used to protect the key, ssh-agent can be used to cache the passphrase.
2. Copy key to remote host
Now try logging into the machine, with "ssh 'root@linuxconfig.org'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
linuxconfig.local$
3. Login to remote host
Can someone help in writing some script through which I can transfer file (scp) from root user in abc server to crt user in hfg server and can give the crt user password in script itself so that it doesn't prompt me every time for password (4 Replies)
I am trying to connect to remote server in hp-ux, using sftp command (using sftp username@ip and password ) able to connect to remote server but, in this case sftp prompt for password and user need to manually enter it.
I want sftp can read a password define in script or from file, so it can... (1 Reply)
Hi,
i want to run the command in remote server through ssh and every time when i run the script its asking to enter the password. I dnt want to enter the password, when i enter the ip address and directly the command shuld execute.
Script:
#!/bin/bash
echo "Enter Server IP Address:"
read... (2 Replies)
how to login with ssh to remote system with out applying the remote root/user password
with rlogin we can ujse .rhosts file
but with ssh howits possible
plz guide (2 Replies)
I have a task requiring that USER_A run a script, which connects to HOST_B as USER_B and does not ask for a password.
If I am logged in on HOST_A as USER_B, I can connect to HOST_B without a password, no problem. However, if I try running ssh with the command line "ssh USER_B@HOST_B" while... (3 Replies)
HI,
I need to write a script ..
when I run this script , will directly goto that remote machine without asking password..
Once it is entered, I needs to transfer some of the log files...
how can I proceed ? (7 Replies)
HI all,
I need to post some files on to a clients machine and they said we can ftp without username and password. I do the same as a command line it works ftp <hostname>. but when I do that through a script it asks for user name and pasword.
Can any one help me how to do a file ftp.
... (4 Replies)
Hi Folks,
I am writing a shell script that can logon to remote machine automatically. But, I am facing one problem. I am using "ssh" command in script and while login into remote machine it asks for passowrd and it stops for STDIN input for password. I want my script to supply password... (2 Replies)
Hi all,
How can i give ftp access to single user on solaris9 system? others should not have the ftp access. i know about ftpusers file in /etc/ftpd but still what about if so many new users are created daily?
And now for that single user how can we restict him to ftp the files only from... (2 Replies)
Hi All
I am new to Unix.
I have write srcipt which will automate the follwing tasks
login to F-Secure server over ssh
copy file from my local server to that server.
Remote server wants to login with out password(ssh-keygen)
I am not getting how to write that scirpt
Please help me... (0 Replies)