mac os查看ssh版本信息

2016-07-11 17:58:04 oYinGui1 阅读数 24501

使用Mac OS X终端SSH登录远程服务器

概述

以下文章主要介绍,在Mac OS X中,使用终端来执行SSH远程登录。

要求

在你开始SSH登录之前你需要:

  • 拥有SSH通行权限。
  • 将 example.com 替换为你的远程服务器域名。

介绍

使用SSH登录远程服务器

打开你的终端之后,你将看到一个$符号,后面紧跟一个闪烁的光标,这是基本的命令输入提示。在这里,你可以使用以下最基本的SSH登录命令来登入你的远程服务器,形式如下:

ssh root@example.com

在命令输入不久后,你的计算机将进行与远程服务器的连接。如果你是第一次连接你的远程服务器,那就会出现如下的系统提示:

The authenticity of host ‘example.com (xxx.xxx.xxx.xxx)’ can’t be established.

RSA key fingerprint is f9:………….

Are you sure you want to continue connecting (yes/no) _

接下来,你只要键入yes,然后保证你拥有正确登录密码就行了,直接回车。

然后你将被提示键入登录密码:

root@example.com’s password: _

你可以键入或者复制粘贴你的密码到终端,之后回车,这样你就可以登录远程服务器了!

2016-12-03 19:42:17 xicikkk 阅读数 40150

    Mac OS X系统已经默认安装了SSH,但是SSH服务并未启用,这样你就不能远程登录。

    要启用SSH服务的方法:

    进入“系统偏好设置”,找到“共享”,勾选“远程登录”

    即可立即启动SSH服务,你可以在客户机上用ssh 用户名@Mac主机IP远程登录到这台Mac上。





2017-11-29 15:29:29 weixin_38355083 阅读数 25519

因为一些原因需要重新生成github的ssh Key,但是找不到之前的安装路径的了。

好在我是选择默认路径的,因此要找到ssh文件夹下的id_rsa.pub文件,只需要:

打开终端输入

[plain] view plain copy
  1. $ open ~/.ssh  

即可,打开文件夹,就可以找到id_rsa.pub文件了。


ssh生成的.pub文件
(使用cd命令进入id_rsa.pub目录,再使用more id_rsa.pub命令查看公钥的内容)

2016-12-11 17:41:57 robertsong2004 阅读数 12171

本文转载至:https://www.cyberciti.biz/faq/mac-osx-find-tell-operating-system-version-from-bash-prompt/

use ssh client to login into my Mac Min server without GUI. How can I tell what version of Mac OS X operating system am I using command prompt? How do I find out Mac OS X version from Terminal app bash shell?


On Apple Mac OS X you need to use the following command to find out operating system version:

  1. system_profiler command – Show Apple hardware and software configuration.
  2. sw_vers command – Show Mac OS X operating system version.
  3. uname command – Show operating system name and more.

Determine OS X version from the command line

Open the terminal app and type the following command:
$ sw_vers
Sample outputs:

Fig. 01: Find OS X version from the command line

Fig. 01: Find OS X version from the command line


Where, you can pass the following options:

  1. -productName – Print just the value of the ProductName property.
  2. -productVersion – Print just the value of the ProductVersion property.
  3. -buildVersion – Print just the value of the BuildVersion property.

Say hello to system_profiler

You can use the system_profiler command as follows to get the same information:
$ system_profiler | less
$ system_profiler SPSoftwareDataType

Sample outputs:

Fig.02: Tell what version of OS X you are using on from the command line

Fig.02: Tell what version of OS X you are using on from the command line

Using SystemVersion.plist file

The above commands use /System/Library/CoreServices/SystemVersion.plist file. One can print the version info as follows:
$ cat /System/Library/CoreServices/SystemVersion.plist
Sample outputs:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>ProductBuildVersion</key>
	<string>15B42</string>
	<key>ProductCopyright</key>
	<string>1983-2015 Apple Inc.</string>
	<key>ProductName</key>
	<string>Mac OS X</string>
	<key>ProductUserVisibleVersion</key>
	<string>10.11.1</string>
	<key>ProductVersion</key>
	<string>10.11.1</string>
</dict>
</plist>

On Mac OS X server, try:
$ cat /System/Library/CoreServices/ServerVersion.plist

How do I find out OS X Darwin kernel version?

Simply type the following uname command to see operating system name including the machine hardware name, the nodename, the machine processor architecture name, the operating system release, the operating system name, and the operating system version:
$ uname -av
Sample outputs:

Darwin Viveks-MacBook-Pro.local 15.0.0 Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015; root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64

Tip: Read OS X version in audio format

Type the following bash command to hear OS X version using the say command on OS X:

say $(sw_vers) 
say $(sw_vers -productName && sw_vers -productVersion | sed 's/10//')

2019-03-12 09:02:04 wanglemao 阅读数 473

启动服务:

sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist

停止服务:

sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist

查看服务器状态:

sudo launchctl list | grep sshd
-   0   com.openssh.sshd

 

Mac OS X ssh设置

阅读数 457