神刀安全网

Create SSH shortcut in Linux

I got quite a few servers where I login via SSH. As a Linux user, I feel tired typing more than few things at a time (not my fault!), so I decided to create SSH shortcuts and save it to my desktop. From then, all I needed to do is open that shortcut and just type in my password of tokenID depending on the server’s I am using. So, in this guide, I will demonstrate how to create SSH shortcut in Linux.

First go to Desktop (or where-ever you want to save these shortcuts) and create a file named production.desktop .

blackmore@blackTOP:~/Desktop$ cd /home/blackmore/Desktop/ blackmore@blackTOP:~/Desktop$  blackmore@blackTOP:~/Desktop$ vi production.desktop

Copy paste the following codes in the file:

[Desktop Entry] Version=1.0 Name=My Server Comment=Login to Prod Exec=mate-terminal --disable-factory --sm-client-disable --class=MyServer -x ssh -t root@example.com StartupWMClass=MyServer Terminal=false X-MultipleArgs=false Type=Application Icon=utilities-terminal StartupNotify=true

Create SSH shortcut in Linux The most important thing you need to change is the user and server name (FQDN) i.e. root@example.com to something like andrew@10.1.1.30 or sam@myserver.com etc. Depending on your Linux distro, you might also need to change Icon=utilities-terminal as this name might not be same.

Save the file and then change the permission to the file:

blackmore@blackTOP:~/Desktop$ chmod -R +rwx production.desktop

You should see an ICON on your desktop with MyServer name.

Right click-open or double-click both would fire up a SSH session to your server with username pre-filled waiting for your password/token/security code. Pretty neat!

On a side note, if you are trying to secure your servers, then perhaps use CSF Firewall and limit it by country code as shown inhere. I’ve always found CSF to be better compared to Fail2Ban.

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Create SSH shortcut in Linux

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址