Saturday, April 27, 2024
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 3468  / 1 Year ago, sun, march 19, 2023, 5:12:39

I've been trying to install ubuntu-server on an old laptop. It has a screen and keyboard but the "u" and "p" keys don't work so I can't type sudo or apt. I thus could not set up ssh using the generic boot disk. I tried making a preseed.cfg file and putting it in the root directory of the usb disk and editing syslinux.cfg but it didn't work.

What I'm asking is if someone could please post detailed instructions and the full text of what I need in my preseed.cfg file in order to get the server to automatically install. I've tried several guides on the internet and looked at this website but the instructions were too vague for me to follow.
I can also run any commands necessary that don't need "u" or "p" but it would be nice if everything was automatic. But please post the entire preseed.cfg so I can just paste it in. Here's what I have in syslinux.cfg now (generic):



# D-I config version 2.0
include menu.cfg
default vesamenu.c32
prompt 0
timeout 0
ui gfxboot bootlogo

More From » system-installation

 Answers
1

How to use corrupted keys 's' and 'u'


This method can be used to type missing keyboard charactors even in tty where mouse support is unavailable, in which you can't use copy-paste.


Command echo -e 'x73' will print



s



Where 73 is the hex equalent of s. To find hex of other charactors see the ascii table from man ascii.

Now let's store it in a variable, say w1 w1=$(echo -e 'x73'). So to use sudo type ${w1}udo.

example

whoami



ubuntu



${w1}udo whoami



root



other methods

shell expansation : In this case you can use the expansion feature of bash as follows

/usr/bin/?udo /usr/bin/a?t will be expanded to
/usr/bin/sudo /usr/bin/apt. The ? will match a single character.

Repeated use

For repeated daily use, create an alias or function.


w1=$(echo -e 'x73')
w2=$(echo -e 'x70')

alias aat-get="${w1}udo a${w2}t-get "

Now you can use aat-get instead of apt-get. For the changes to persistent add the above code to ~/.bashrc


[#24063] Monday, March 20, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mocipe

Total Points: 161
Total Questions: 106
Total Answers: 118

Location: Cambodia
Member since Thu, Oct 7, 2021
3 Years ago
;