I managed to copy them back to USB. Where should i copy them now and which exact files so ssh via putty can work again with saved session?Thank you for the upgrade @Voxel !
Can someone help me? I have lost SSH & WinSCP connection to the router.
I have saved the entire ssh folder containing id_dropbear, id_rsa, id_rsa.pub & privatekey.ppk when i created the ssh keys the first time, on my PC. I dont have the folder on the USB attached to the router.
How do I add them back to router and in which folder? I only currently have telnet access.
I have saved the entire ssh folder containing id_dropbear, id_rsa, id_rsa.pub & privatekey.ppk when i created the ssh keys the first time, on my PC. I dont have the folder on the USB attached to the router.
I managed to copy them back to USB. Where should i copy them now so ssh via putty can work again?
#!/bin/sh
. . .
# Autorestore from backup if flashing new firmware is detected
if [ ! -f /root/.ssh/authorized_keys ]; then
cd /
tar xf /mnt/optware/backup/root.tar
echo "Flashing new firmware is detected. Restore settings from archive." > /tmp/autorun.log
fi
Listed set of your files is not enough to restore ssh access. Did not you backup your authorized_keys file? Exactly this file is needed to allow your access by ssh from putty (PC) to the router. It should be in the /root/.ssh directory i.e.
/root/.ssh/authorized_keys
and its permission should be set to 0600
chmod 0600 /root/.ssh/authorized_keys
If you did not backup it, you should be able to restore it manually from your putty key privatekey.ppk. Load it to puttygen.exe and you can see what to add into your /root/.ssh/authorized_keys using e.g. 'nano' text editor
nano /root/.ssh/authorized_keys
puttygen.exe displays what to paste into /root/.ssh/authorized_keys using COPY/PASTE
View attachment 30878
P.S.
It is rightly pointed by @HELLO_wORLD:
Voxel - Custom firmware build for R7800 v. 1.0.2.82SF & v. 1.0.2.82.1SF & v. 1.0.2.82.2SF
Hello Voxel, i am a newbie here, i have followed your firmware documentation to install entware on 81.1sf, i also installed Kamoj add-on too. Am i need to install kamoj add-on again after upgraded to 82sf? or do i need to remove kamoj add-on first in order to install 82sf? btw very happy to work...www.snbforums.com
E.g. part of my /mnt/sda1/autorun/scripts/post-mount.sh:
Code:#!/bin/sh . . . # Autorestore from backup if flashing new firmware is detected if [ ! -f /root/.ssh/authorized_keys ]; then cd / tar xf /mnt/optware/backup/root.tar echo "Flashing new firmware is detected. Restore settings from archive." > /tmp/autorun.log fi
I.e. it is better to make a backup storing whole /root directory (once) and to provide "autorestore" as in example above.
Voxel.
However when trying to edit /root/.ssh/authorized_keys I get an empty file which won't save no matter how I edit it. I copy-paste the key and pressing :wq! won't save anything. Any advise?
mkdir /root/.ssh
I have already tried it but with no avail:Run first:
Code:mkdir /root/.ssh
This directory '/root/.ssh' just does not exist. So you cannot save your file in non-exsistent directory...
After that repeat your actions again.
Voxel.
ls -la /root
ls -la /root/.ssh
Hmm looks like a folder that won't get deleted?Maybe you have a file '/root/.ssh' ? Or permissions?
Code:ls -la /root ls -la /root/.ssh
If it is file, remove it...
Voxel.
Hmm looks like a folder that won't get deleted?
rm -f /root/.ssh
Many thanks & very sorry for your trouble! SSH now works again. WinSCP still wont connect though.No, it is file.
Code:rm -f /root/.ssh
Voxel.
No troubles for me, do not worry. We are here to help each other.Many thanks & very sorry for your trouble! SSH now works again. WinSCP still wont connect though:
Many thanks & very sorry for your trouble! SSH now works again. WinSCP still wont connect though.
EDIT: SSH key was missing. Please ignore my last post and again many thanks for your work, effort and support!
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!