ssh在远程主机上创建文件_愚蠢的怪胎技巧:创建快捷方式以快速编辑主机文件...

ssh在远程主机上创建文件

ssh在远程主机上创建文件

As a programmer that does a lot of work on web sites, I end up having to edit my hosts file far too often, and in Windows 7 or Vista, you have to use Notepad in Administrator Mode. Tedious.

作为在网站上进行大量工作的程序员,我最终不得不过于频繁地编辑主机文件,在Windows 7或Vista中,您必须在管理员模式下使用记事本。 乏味。

My quick and easy solution to this problem is so simple that it barely deserves a full article, but we’re going to cover it anyway—basically, you just create a shortcut to edit the file in Notepad, and set the properties to always start as Administrator. The final step is to create that shortcut in the Start Menu, so it will be easily accessible with the start menu search engine.

我对这个问题的快速简便的解决方案是如此简单,以至于几乎不值得写整篇文章,但是无论如何我们还是要覆盖它—基本上,您只需创建一个快捷方式即可在记事本中编辑文件,并将属性设置为始终启动以管理员身份。 最后一步是在“开始”菜单中创建该快捷方式,因此可以通过“开始”菜单搜索引擎轻松访问该快捷方式。

Once you’re done, all you have to do is type hosts into the start menu, and you can edit the Hosts file.

完成后,您要做的就是在开始菜单中键入主机 ,然后您可以编辑主机文件。

Let’s Make a Shortcut! 

让我们做个捷径吧!

Open up the start menu folder—for those of you that might be new, we’ve covered how to easily open up the start menu folder in Windows 7. Then right-click and create a shortcut, with the following location:

打开开始菜单文件夹-对于那些可能是新手的人,我们已经介绍了如何在Windows 7中轻松打开开始菜单文件夹 。 然后右键单击并在以下位置创建快捷方式:

notepad c:\windows\system32\drivers\etc\hosts

记事本c:\ windows \ system32 \ drivers \ etc \ hosts

image

Once you’ve created the shortcut, and make sure you give it a useful name like “Edit Hosts”, you should open up the shortcut properties, click the Advanced button, and then select the “Run as administrator” option.

一旦创建了快捷方式,并确保给它一个有用的名称,如“ Edit Hosts”,就应该打开快捷方式属性,单击“高级”按钮,然后选择“以管理员身份运行”选项。

image

Once you’ve done so, you can simply type hosts into the start menu to pull up the item…

完成此操作后,您只需在开始菜单中键入主机即可拉出该项目…

image

You’ll be prompted to accept the UAC prompt, since you have to edit the hosts file in administrator mode.

系统将提示您接受UAC提示,因为您必须在管理员模式下编辑主机文件。

image

And there we are. Edit away!

我们到了。 编辑吧!

image

And yes, you might point out that you can simply change the permissions on the Hosts file to not require admin mode, but that would lead to a less secure system, since malware often tries to edit the hosts file.

是的,您可能会指出,您可以简单地将Hosts文件的权限更改为不需要管理模式,但这会导致系统的安全性降低,因为恶意软件通常会尝试编辑hosts文件。

Also, you might point out that this was such a simple and easy topic that I shouldn’t have bothered. But I did! Loss of geek points for me.

另外,您可能会指出,这是一个如此简单的主题,我不应该理会。 但是我做到了! 我失去了极客点。

翻译自: https://www.howtogeek.com/howto/6540/stupid-geek-tricks-create-a-shortcut-to-quickly-edit-your-hosts-file/

ssh在远程主机上创建文件

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值