scripting
good day folks
I need to write a script which restricts X User login to a list of specific servers for him to choose the desired server then for the user to insert a generic user password to access normally on that server normally as a command line privileged user I am so bad in scripting and I need this help for me to solve a lot Thanks in advance |
Find the pieces one at at time and them together, in sequence, in a text file.
The step I'd start with would be the remote login. However, you do not want to keep passwords around in any files. The way to do remote login these days is with keys over SSH. Use RSA or Ed25519 keys only, but other than that most of the tutorials and how-tos will be relevant. |
Quote:
|
Ok. Then use Ed25519 instead of RSA then. ssh-keygen works about the same to generate the key, just add -t ed25519 to your options to produce the right key type. The public component of the key pair will then go into authorized_keys on the intermediate host as you would for RSA.
|
Quote:
|
If you really want a shell script, then you can use a case statement. Scripting would be the hard way to go about it.
If you go with SSH you do not need a script. You can put a shortcut in ~/.ssh/config and that will handle all your connection options. Code:
Host one |
In scripting you can provide a menu interface that only specifies certain hosts to which they can connect. It is using the keys properly that you RESTRICT their ability to connect to hosts OUTSIDE of the script, and enable the script to make the desired connections.
You cannot just say "I want a script to do everything" because scripts (shells) do not manage all of the parts involved. You have to use the tools properly to make a working and reasonably secure solution. |
All times are GMT -5. The time now is 05:58 PM. |