How to remove wrong value from nvram?

Igor

Regular Contributor
RT-AX68U fw Merlin 386.4. I see wrong value in nvram
Code:
# nvram show | grep sshd
...
sshd_authkeysjBWlBI+BSlX7jHcj7qjg5sIp4sscfUfe1KWIF0bOucMq8AvwNiyDVwJdeXSTL4u2Npji1FCRPAAsHmOAtIxPZv0KQ2AqAOU/[email protected]
...

Trying to delete.
Code:
# nvram unset sshd_authkeysjBWlBI+BSlX7jHcj7qjg5sIp4sscfUfe1KWIF0bOucMq8AvwNiyDVwJdeXSTL4u2Npji1FCRPAAsHmOAtIxPZv0KQ2AqAOU/[email protected]
Not deleted.

Code:
# nvram savefile test
# nano test
(delete line)
# nvram loadfile test
# nvram commit
Not deleted.

I have a longer wrong value
Code:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCgFMsRSAXQj8s7JceAdX3DzGSjJzIa+wtMAFwpjoqqbIJHpHzyBbSO5t4hJmL4O8HNuGoCkv2L72Znt0h7HTOk2NjGAWYrHMFee/rwaO5KDkGfVIPBHFqsUH/QR2HDd12Ix++jZGgttMx3TuL8yXsS4Zebc0QTpzq/NMG9CQvsPgj7cP0iOP3KZll3n/H2WtLq1zDRDoSOksX+4MDjslQxskN90e34DLwsIbrGaRoi ...

How to remove wrong value from nvram?
 

eibgrad

Part of the Furniture
Go to Administration > System > SSH section and install correct public (Authorized) key(s) then Save.
 

Igor

Regular Contributor
The GUI shows the correct keys. Same as "sshd_authkeys=" nvram section. I'm talking about the erroneous value of nvram. It has nothing to do with correct value "sshd_authkeys=".
 

eibgrad

Part of the Furniture
Then set nvram variable to null and start over w/ GUI.

Code:
nvram set sshd_authkeys=''
nvram commit
 

Igor

Regular Contributor
Code:
nvram set sshd_authkeys=''
nvram commit
nvram show | grep ssh-
size: 78756 bytes (52316 left)
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCgFMsRSAXQj8s7JceAdX3 [skip]
 

eibgrad

Part of the Furniture
Why grep ssh- ?? That could be from some other variable. Show me the variable.

Code:
nvram get sshd_authkeys
 

eibgrad

Part of the Furniture
If grep'ing ssh- returned something, then it looks like you accidentally installed ssh-rsa as a variable (I don't have such a variable on my system). If that's the case, you can null it as well.
 

Igor

Regular Contributor
Code:
@RT-AX68U-92A0:/tmp/home/root# nvram get sshd_authkeys

@RT-AX68U-92A0:/tmp/home/root#
 

eibgrad

Part of the Furniture
Code:
@RT-AX68U-92A0:/tmp/home/root# nvram get sshd_authkeys

@RT-AX68U-92A0:/tmp/home/root#

Then the Authorized Keys field on Administration->System->SSH should now be empty. Add your key(s) back there and Save.
 

Igor

Regular Contributor
I have two identical routers. One of them has entry which is like value. I can't delete it in any way.
 

dave14305

Part of the Furniture
Code:
nvram unset "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCgFMsRSAXQj8s7JceAdX3"
But include all the characters up to the = sign before garry. Do not include the equal sign.
 

eibgrad

Part of the Furniture
Code:
nvram unset "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCgFMsRSAXQj8s7JceAdX3"
But include all the characters up to the = sign before garry. Do not include the equal sign.

Ah, finally realized the OP has created a variable by the same name as the key!

While it should be removed, I don't see why it should cause issues w/ getting the Authorized Keys field configured properly.
 

Igor

Regular Contributor
But include all the characters up to the = sign before garry. Do not include the equal sign.
Does not work. I put this long variable in double quotes - I can't delete it. Single quotes can't be removed either.
 

dave14305

Part of the Furniture
I would just reset to defaults and start over. or restore a good backup before this issue started.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top