I have a VPS that I have installed cmake, and Hiawatha on to without problems. The ip address provides a webpage when viewed in the browser so that is working fine.
My document root is to be loaded from my git repository on assembla.com.
I am running the console remotely as the VPS root user. Let me show how I am trying to do this.
[root@server /]$ cd .\ [root@server ~]$ cd .ssh/id_rsa
Then I remove all keys since I've already messed with them and failed I'll start clean.
[root@server id_rsa]$ rm -f * [root@server id_rsa]$ dir ->(and nothing comes up) [root@server id_rsa]$ ssh-keygen -t rsa -f mykey [root@server id_rsa]$ dir ->(mykey mykey.pub)
Let's say I make the password be dog1234 and enter it once for each prompt.
[root@server id_rsa]$ cd ../ [root@server .ssh]$ chmod 600 -R id_rsa
Now to check to see what ssh-agents are running...
[root@server .ssh]$ ps aux | grep ssh
The output is...
root 29700 0.0 0.0 57704 764 ? Ss 00:32 0:00 ssh-agent root 29718 0.0 0.0 57704 724 ? Ss 00:38 0:00 ssh-agent root 29782 0.0 0.0 57704 768 ? Ss 01:32 0:00 ssh-agent -s root 29884 0.0 0.0 57704 752 ? Ss 02:03 0:00 ssh-agent -s root 29893 0.0 0.0 103248 844 pts/0 S+ 02:17 0:00 grep ssh
The last one is the command I ran to check these. In keeping clean starts in mind I kill each of those PIDs...
[root@server .ssh]$ kill 29700 [root@server .ssh]$ kill 29718 [root@server .ssh]$ kill 29782 [root@server .ssh]$ kill 29884
To verify that it killed them...
[root@server .ssh]$ ps aux | grep ssh
The output once again...
root 29899 0.0 0.0 103248 848 pts/0 S+ 02:22 0:00 grep ssh
Which is the grep command itself. If i try to kill 29899 it says it doesn't exist, which is correct since the command has already finished executing and it is not an ssh agent.
Now this is most likely where things go bad. First, I want to make notice of the fact that this terminal behaves differently being CentOS than ubuntu, which I am used to. For some reason, any command that has a question that requires a yes or no response causes current processes from terminal commands to break and stop.
For example when I did the command earlier:
ssh-keygen -t rsa -f mykey
I added -f mykey to name the file. If I waited for the prompt to enter a name it fails. Does anyone know why this is happening? Is it because I am connected to the server remotely? Is this a possible reason that my password (which I am about to get to) isn't working?
Now I start the ssh-agent since I killed them all.
[root@server .ssh]$ eval `ssh-agent`
Agent pid 29910
[root@server .ssh]$ cd id_rsa [root@server id_rsa]$ ssh-add -l
The agent has no identities.
Now I need to add them.
[root@server id_rsa]$ ssh-add mykey.pub
This is where I don't understand what's happening.
[root@server id_rsa]# ssh-add mykey.pub Enter passphrase for mykey.pub: Bad passphrase, try again for mykey.pub: Bad passphrase, try again for mykey.pub: Bad passphrase, try again for mykey.pub: Bad passphrase, try again for mykey.pub: Bad passphrase, try again for mykey.pub: Bad passphrase, try again for mykey.pub:
I am entering dog1234 as the password, and this appears to keep on going indefinitely.
vim /etc/ssh/sshd_config #KeyRegenerationInterval 1h #ServerKeyBits 1024 # Logging # obsoletes QuietMode and FascistLogging #SyslogFacility AUTH SyslogFacility AUTHPRIV #LogLevel INFO # Authentication: #LoginGraceTime 2m PermitRootLogin yes #StrictModes yes #MaxAuthTries 6 #MaxSessions 10 RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys #AuthorizedKeysCommand none #AuthorizedKeysCommandRunAs nobody # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts #RhostsRSAAuthentication no # similar for protocol version 2 #HostbasedAuthentication no # Change to yes if you don't trust ~/.ssh/known_hosts for # RhostsRSAAuthentication and HostbasedAuthentication #IgnoreUserKnownHosts no # Don't read the user's ~/.rhosts and ~/.shosts files #IgnoreRhosts yes # To disable tunneled clear text passwords, change to no here! #PasswordAuthentication yes #PermitEmptyPasswords no PasswordAuthentication yes # Change to no to disable s/key passwords #ChallengeResponseAuthentication yes ChallengeResponseAuthentication no # Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosGetAFSToken no # GSSAPI options #GSSAPIAuthentication no GSSAPIAuthentication yes #GSSAPICleanupCredentials yes GSSAPICleanupCredentials yes #GSSAPIStrictAcceptorCheck yes #GSSAPIKeyExchange no # Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via ChallengeResponseAuthentication may bypass # the setting of "PermitRootLogin without-password". # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and ChallengeResponseAuthentication to 'no'. #UsePAM no UsePAM yes # Accept locale-related environment variables AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE AcceptEnv XMODIFIERS #AllowAgentForwarding yes #AllowTcpForwarding yes #GatewayPorts no #X11Forwarding no X11Forwarding no #X11DisplayOffset 10 #X11UseLocalhost yes #PrintMotd yes #PrintLastLog yes #TCPKeepAlive yes #UseLogin no #UsePrivilegeSeparation yes #PermitUserEnvironment no #Compression delayed #ClientAliveInterval 0 #ClientAliveCountMax 3 #ShowPatchLevel no #UseDNS yes #PidFile /var/run/sshd.pid #MaxStartups 10 #PermitTunnel no #ChrootDirectory none # no default banner path #Banner none # override default of no subsystems Subsystem sftp /usr/libexec/openssh/sftp-server # Example of overriding settings on a per-user basis #Match User anoncvs # X11Forwarding no # AllowTcpForwarding no # ForceCommand cvs server
Lastly, I do not have an authorized_keys folder in the .ssh directory. All of the things I have found in other questions do not seem to work.
Why can I not add the identity?