Computing

Linux aliases help

Submitted by hanleyjaa123, , Thread ID: 231611

Thread Closed
hanleyjaa123
Junior Member
Level:
0
Reputation:
4
Posts:
74
Likes:
2
Credits:
23
19-01-2022, 12:54 AM
This post was last modified: 19-01-2022, 12:56 AM by hanleyjaa123
#1
im running Kali Linux 2021.4 OS and in the ~/.bashrc it says if you want to add permanent aliases then you should use the ~/.bash_aliases file, which i have edited with the following:

alias hanley='ssh hanleyjaa@ 10.0.0.8' <there is no space between the @ in the file, but the forums turns it into me referencing a user.

a simple command to ssh into the local server, but when saving the file and even using source ~/.bash_aliases the command simply does not work, it is an unrecognized command. ive tried to put it directly into the ~/.bashrc file and it doesn't work.

another problem that is when i use the source command on ~/.bashrc it spits out a ton of error codes and doesn't work.

https://i.imgur.com/pVo8Kok.png

I have no clue what the random characters are at the bottom of the terminal, after you try the command you can't get back to the terminal line to input more commands you have to kill the terminal or open a new one. does anyone know why this is happening or how to fix??

RE: Linux aliases help

idkbro555
Newbie
Level:
1
Reputation:
0
Posts:
17
Likes:
0
Credits:
0
19-01-2022, 01:00 AM
#2
I believe it is not possible for you to create an alias for an ssh connection because it involves some parameters eg SSH (command) hanleyjaa@ 10.0.0.8(parameter). As far as I know aliases are for adding commands that you downloaded from github for example and left in the downloads folder. (I could be wrong)

RE: Linux aliases help

hanleyjaa123
Junior Member
Level:
0
Reputation:
4
Posts:
74
Likes:
2
Credits:
23
OP
19-01-2022, 01:04 AM
This post was last modified: 19-01-2022, 01:04 AM by hanleyjaa123
#3
19-01-2022, 01:00 AM
idkbro555 Wrote:
I believe it is not possible for you to create an alias for an ssh connection because it involves some parameters eg SSH (command) hanleyjaa@ 10.0.0.8(parameter). As far as I know aliases are for adding commands that you downloaded from github for example and left in the downloads folder. (I could be wrong)

SSH in aliases work, because i am able to create a temporary one by using the alias command in CLI but when system reboots the command is erased

19-01-2022, 01:00 AM
idkbro555 Wrote:
I believe it is not possible for you to create an alias for an ssh connection because it involves some parameters eg SSH (command) hanleyjaa@ 10.0.0.8(parameter). As far as I know aliases are for adding commands that you downloaded from github for example and left in the downloads folder. (I could be wrong)

SSH in aliases work, because i am able to create a temporary one by using the alias command in CLI but when system reboots the command is erased

RE: Linux aliases help

idkbro555
Newbie
Level:
1
Reputation:
0
Posts:
17
Likes:
0
Credits:
0
19-01-2022, 01:08 AM
This post was last modified: 19-01-2022, 01:11 AM by idkbro555
Warned
#4
19-01-2022, 01:04 AM
hanleyjaa123 Wrote:
SSH in aliases work, because i am able to create a temporary one by using the alias command in CLI but when system reboots the command is erased


[font=-apple-system, BlinkMacSystemFont, Inter, Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"]Well then I can't really help you because I don't use kali and I'm used to doing the alias through the terminal and even after restarting the alias remains. And a note to the print you put this private[/font]

have you tried this? https://lewiscomputerhowto.blogspot.com/...-kali.html

RE: Linux aliases help

hanleyjaa123
Junior Member
Level:
0
Reputation:
4
Posts:
74
Likes:
2
Credits:
23
OP
20-01-2022, 08:42 PM
#5
19-01-2022, 01:08 AM
idkbro555 Wrote:

[font=-apple-system, BlinkMacSystemFont, Inter, Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"]Well then I can't really help you because I don't use kali and I'm used to doing the alias through the terminal and even after restarting the alias remains. And a note to the print you put this private[/font]

have you tried this? https://lewiscomputerhowto.blogspot.com/...-kali.html

yeah, I couldn't figure it out either. I tried setting permanent aliases on Ubuntu server 20.04 and raspberry pi and it works as intended with no flaws, but on Kali Linux, it doesn't work.

Users browsing this thread: 1 Guest(s)