Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by BharathKumarRaju DasaraRaju
at 2024-07-26 19:25:29
Point:500 Replies:6 POST_ID:829124USER_ID:11540
Topic:
SSH / Telnet Software;Linux;Linux Networking
error in ssh using without password.
local machine:
=================>
[root@bharathkumar .ssh]# ip a | grep -i inet | grep -i brd
inet 192.168.80.129/24 brd 192.168.80.255 scope global eth0
[root@bharathkumar .ssh]# hostname
bharathkumar.test.com
[root@bharathkumar .ssh]# pwd
/root/.ssh
[root@bharathkumar .ssh]# ls -lrt
total 12
-rw-------. 1 root root 1675 Jul 26 18:40 id_rsa
-rw-r--r--. 1 root root 408 Jul 26 18:44 id_rsa.pub
-rw-r--r--. 1 root root 396 Jul 26 18:44 known_hosts
[root@bharathkumar .ssh]# cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA13kx9nOLlccO+XInzua6GqzD4oT9lEnY7AZ8+A5IDKGwzr9dG9I64IFKCZNESzKfqm8/JuciWd9LfpChuiKyQKyEux/Ub38FmPMQvxmtB+QyI69yVECOWYx7Q3B49uyfhXX0QRZneXXybS7KuUZvz1lrnaKD4Gn/NkXvGNcB7pBF3aDkYYZb6JJvno+KO4oI0u9Km1pui6nb4n9KxWWGeBjVPy68rPW8Zvz2qSWUwaZ6HsHbVVpLU5jdAQsa3G5doc1AATJsr7GrUghEX8VhSo0Qhpk9psTmPkpc9I43JfeWSdca32R1ocp7RufJQXWQHaYCcCyPv5Ha9gJ845N/Uw== root@bharathkumar.test.com
[root@bharathkumar .ssh]#
On Remote machine:
====================>
[root@bharathkumar .ssh]# hostname
bharathkumar.trimble2
[root@bharathkumar .ssh]# ip a | grep -i inet | grep -i brd
inet 192.168.80.130/24 brd 192.168.80.255 scope global eth0
[root@bharathkumar .ssh]# ls -lart
total 28
-rw-------. 1 root root 50 Jul 24 08:38 nohup.out
-rw-r--r--. 1 root root 408 Jul 24 08:41 id_rsa.pub
-rw-------. 1 root root 1675 Jul 24 08:41 id_rsa
-rw-r--r--. 1 root root 396 Jul 26 18:42 known_hosts
-rw-r--r--. 1 root root 408 Jul 26 18:44 authorized_keys
dr-xr-x---. 3 root root 4096 Jul 26 18:44 ..
drwxr-xr-x. 2 root root 4096 Jul 26 18:44 .
[root@bharathkumar .ssh]# cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA13kx9nOLlccO+XInzua6GqzD4oT9lEnY7AZ8+A5IDKGwzr9dG9I64IFKCZNESzKfqm8/JuciWd9LfpChuiKyQKyEux/Ub38FmPMQvxmtB+QyI69yVECOWYx7Q3B49uyfhXX0QRZneXXybS7KuUZvz1lrnaKD4Gn/NkXvGNcB7pBF3aDkYYZb6JJvno+KO4oI0u9Km1pui6nb4n9KxWWGeBjVPy68rPW8Zvz2qSWUwaZ6HsHbVVpLU5jdAQsa3G5doc1AATJsr7GrUghEX8VhSo0Qhpk9psTmPkpc9I43JfeWSdca32R1ocp7RufJQXWQHaYCcCyPv5Ha9gJ845N/Uw== root@bharathkumar.test.com
[root@bharathkumar .ssh]#
I added the local machines id_rsa.pub key to the authorized_keys file in remote machine. but still i am unable to ssh without password from local machine...it is asking password agin?
[root@bharathkumar ~]# ip a | grep -i inet | grep -i brd
inet 192.168.80.129/24 brd 192.168.80.255 scope global eth0
[root@bharathkumar ~]# ssh -l root 192.168.80.130
root@192.168.80.130's password:
local machine:
=================>
[root@bharathkumar .ssh]# ip a | grep -i inet | grep -i brd
inet 192.168.80.129/24 brd 192.168.80.255 scope global eth0
[root@bharathkumar .ssh]# hostname
bharathkumar.test.com
[root@bharathkumar .ssh]# pwd
/root/.ssh
[root@bharathkumar .ssh]# ls -lrt
total 12
-rw-------. 1 root root 1675 Jul 26 18:40 id_rsa
-rw-r--r--. 1 root root 408 Jul 26 18:44 id_rsa.pub
-rw-r--r--. 1 root root 396 Jul 26 18:44 known_hosts
[root@bharathkumar .ssh]# cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA13kx9nOLlccO+XInzua6GqzD4oT9lEnY7AZ8+A5IDKGwzr9dG9I64IFKCZNESzKfqm8/JuciWd9LfpChuiKyQKyEux/Ub38FmPMQvxmtB+QyI69yVECOWYx7Q3B49uyfhXX0QRZneXXybS7KuUZvz1lrnaKD4Gn/NkXvGNcB7pBF3aDkYYZb6JJvno+KO4oI0u9Km1pui6nb4n9KxWWGeBjVPy68rPW8Zvz2qSWUwaZ6HsHbVVpLU5jdAQsa3G5doc1AATJsr7GrUghEX8VhSo0Qhpk9psTmPkpc9I43JfeWSdca32R1ocp7RufJQXWQHaYCcCyPv5Ha9gJ845N/Uw== root@bharathkumar.test.com
[root@bharathkumar .ssh]#
On Remote machine:
====================>
[root@bharathkumar .ssh]# hostname
bharathkumar.trimble2
[root@bharathkumar .ssh]# ip a | grep -i inet | grep -i brd
inet 192.168.80.130/24 brd 192.168.80.255 scope global eth0
[root@bharathkumar .ssh]# ls -lart
total 28
-rw-------. 1 root root 50 Jul 24 08:38 nohup.out
-rw-r--r--. 1 root root 408 Jul 24 08:41 id_rsa.pub
-rw-------. 1 root root 1675 Jul 24 08:41 id_rsa
-rw-r--r--. 1 root root 396 Jul 26 18:42 known_hosts
-rw-r--r--. 1 root root 408 Jul 26 18:44 authorized_keys
dr-xr-x---. 3 root root 4096 Jul 26 18:44 ..
drwxr-xr-x. 2 root root 4096 Jul 26 18:44 .
[root@bharathkumar .ssh]# cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA13kx9nOLlccO+XInzua6GqzD4oT9lEnY7AZ8+A5IDKGwzr9dG9I64IFKCZNESzKfqm8/JuciWd9LfpChuiKyQKyEux/Ub38FmPMQvxmtB+QyI69yVECOWYx7Q3B49uyfhXX0QRZneXXybS7KuUZvz1lrnaKD4Gn/NkXvGNcB7pBF3aDkYYZb6JJvno+KO4oI0u9Km1pui6nb4n9KxWWGeBjVPy68rPW8Zvz2qSWUwaZ6HsHbVVpLU5jdAQsa3G5doc1AATJsr7GrUghEX8VhSo0Qhpk9psTmPkpc9I43JfeWSdca32R1ocp7RufJQXWQHaYCcCyPv5Ha9gJ845N/Uw== root@bharathkumar.test.com
[root@bharathkumar .ssh]#
I added the local machines id_rsa.pub key to the authorized_keys file in remote machine. but still i am unable to ssh without password from local machine...it is asking password agin?
[root@bharathkumar ~]# ip a | grep -i inet | grep -i brd
inet 192.168.80.129/24 brd 192.168.80.255 scope global eth0
[root@bharathkumar ~]# ssh -l root 192.168.80.130
root@192.168.80.130's password:
Author: BharathKumarRaju DasaraRaju replied at 2024-07-26 22:50:30
@Shiju,
Not exactly.... see below
my Remote machine config:
--------------------------------------------->
[root@bharathkumar .ssh]# ip a| grep -i inet | grep -i brd
inet 192.168.80.130/24 brd 192.168.80.255 scope global eth0
[root@bharathkumar .ssh]# ls -ld ~/.ssh
drwxr-xr-x. 2 root root 4096 Jul 26 18:44 /root/.ssh
[root@bharathkumar .ssh]# ls -lrt ~/.ssh
total 20
-rw-------. 1 root root 50 Jul 24 08:38 nohup.out
-rw-r--r--. 1 root root 408 Jul 24 08:41 id_rsa.pub
-rw-------. 1 root root 1675 Jul 24 08:41 id_rsa
-rw-r--r--. 1 root root 396 Jul 26 18:42 known_hosts
-rw-r--r--. 1 root root 816 Jul 26 21:19 authorized_keys
[root@bharathkumar .ssh]#
In Local machine:
-------------------------->
[root@bharathkumar aws]# ip a | grep -i inet | grep -i brd
inet 192.168.80.129/24 brd 192.168.80.255 scope global eth0
[root@bharathkumar aws]# ls -ld ~/.ssh
drwxr-xr-x. 2 root root 4096 Jul 26 18:44 /root/.ssh
You have new mail in /var/spool/mail/root
[root@bharathkumar aws]# ls -lrt ~/.ssh
total 12
-rw-------. 1 root root 1675 Jul 26 18:40 id_rsa
-rw-r--r--. 1 root root 408 Jul 26 18:44 id_rsa.pub
-rw-r--r--. 1 root root 396 Jul 26 18:44 known_hosts
[root@bharathkumar aws]# crontab -l
*/1 * * * * rsync -avz /home/bharath/aws/ 192.168.80.130:/home/bharath/aws1
[root@bharathkumar aws]#
even in crontab also it's working fine many many thanks..have a great day
Not exactly.... see below
my Remote machine config:
--------------------------------------------->
[root@bharathkumar .ssh]# ip a| grep -i inet | grep -i brd
inet 192.168.80.130/24 brd 192.168.80.255 scope global eth0
[root@bharathkumar .ssh]# ls -ld ~/.ssh
drwxr-xr-x. 2 root root 4096 Jul 26 18:44 /root/.ssh
[root@bharathkumar .ssh]# ls -lrt ~/.ssh
total 20
-rw-------. 1 root root 50 Jul 24 08:38 nohup.out
-rw-r--r--. 1 root root 408 Jul 24 08:41 id_rsa.pub
-rw-------. 1 root root 1675 Jul 24 08:41 id_rsa
-rw-r--r--. 1 root root 396 Jul 26 18:42 known_hosts
-rw-r--r--. 1 root root 816 Jul 26 21:19 authorized_keys
[root@bharathkumar .ssh]#
In Local machine:
-------------------------->
[root@bharathkumar aws]# ip a | grep -i inet | grep -i brd
inet 192.168.80.129/24 brd 192.168.80.255 scope global eth0
[root@bharathkumar aws]# ls -ld ~/.ssh
drwxr-xr-x. 2 root root 4096 Jul 26 18:44 /root/.ssh
You have new mail in /var/spool/mail/root
[root@bharathkumar aws]# ls -lrt ~/.ssh
total 12
-rw-------. 1 root root 1675 Jul 26 18:40 id_rsa
-rw-r--r--. 1 root root 408 Jul 26 18:44 id_rsa.pub
-rw-r--r--. 1 root root 396 Jul 26 18:44 known_hosts
[root@bharathkumar aws]# crontab -l
*/1 * * * * rsync -avz /home/bharath/aws/ 192.168.80.130:/home/bharath/aws1
[root@bharathkumar aws]#
even in crontab also it's working fine many many thanks..have a great day
Expert: Shiju Jacob replied at 2024-07-26 22:20:29
the permission of authorized_keys should be 600 it should work
Author: BharathKumarRaju DasaraRaju replied at 2024-07-26 21:24:37
Thank you
Author: BharathKumarRaju DasaraRaju replied at 2024-07-26 21:23:47
@Shiju,
Thank you so much....It works fine. But i manually copied why that time it didn't work....totally confused :( :( thank you so much :)
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.80.130 if we give like this also it will copy the content of the local machine's id_rsa.pub to the authorized_keys file of the remote machine only right?
[root@bharathkumar yum.repos.d]# ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.80.130
root@192.168.80.130's password:
Now try logging into the machine, with "ssh '192.168.80.130'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
[root@bharathkumar yum.repos.d]#
[root@bharathkumar yum.repos.d]# ssh -l root 192.168.80.130
Last login: Sat Jul 26 16:46:09 2014 from 192.168.80.1
[root@bharathkumar ~]#
Thank you so much....It works fine. But i manually copied why that time it didn't work....totally confused :( :( thank you so much :)
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.80.130 if we give like this also it will copy the content of the local machine's id_rsa.pub to the authorized_keys file of the remote machine only right?
[root@bharathkumar yum.repos.d]# ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.80.130
root@192.168.80.130's password:
Now try logging into the machine, with "ssh '192.168.80.130'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
[root@bharathkumar yum.repos.d]#
[root@bharathkumar yum.repos.d]# ssh -l root 192.168.80.130
Last login: Sat Jul 26 16:46:09 2014 from 192.168.80.1
[root@bharathkumar ~]#
Accepted Solution
Expert: Shiju Jacob replied at 2024-07-26 20:27:10
300 points EXCELLENT
try login to local machine 192.168.80.129 and run the below command
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.80.130
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.80.130
Assisted Solution
Expert: duncanb7 replied at 2024-07-26 20:00:10
200 points EXCELLENT
What is your linux distribution ? centos or debain?
Did you read the ssh without password instruction at this site ?
http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/
Duncan
Did you read the ssh without password instruction at this site ?
http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/
Duncan