刚刚创建了一个新的虚拟 Ubuntu 服务器,我正在对其进行强化以供生产使用。我目前有一个 root 帐户。我想做以下事情:
jim在其余部分调用他们)。我希望他们有一个/home/目录。jimSSH 访问权限。jim以su根,但不执行sudo操作。我的问题在于前两项。我已经找到了,useradd但由于某种原因,我无法以通过 SSH 创建的用户身份登录。我是否需要击败 SSHd 才能允许这样做?
我家里有一个 Ubuntu Server 10.10 32 位。我正在通过 Putty 从我的 PC 建立到它的 SSH 连接。
问题是,有时我可以无缝登录。但是,有时它会给我这样的错误:Network error: Connection refused.
然后,我什么都不做,尝试多登录几次,稍等片刻再试一次。有时能登录,有时不能。对我来说似乎很随机。
我能做些什么来解决这个问题?
编辑:
有时,PuttyNetwork error: Software caused connection abort在显示login as:文本后会出错。
这是 ping -t 输出:
Pinging 192.168.2.254 with 32 bytes of data:
Reply from 192.168.2.254: bytes=32 time=6ms TTL=64
Reply from 192.168.2.254: bytes=32 time=65ms TTL=6
Reply from 192.168.2.254: bytes=32 time=88ms TTL=6
Reply from 192.168.2.254: bytes=32 time=1ms TTL=64
Reply from 192.168.2.254: bytes=32 time=3ms TTL=64
Reply from 192.168.2.254: bytes=32 time=1ms TTL=64
Reply from …Run Code Online (Sandbox Code Playgroud) 我想只允许来自某个子网的 SSH 密码身份验证。我看到了全局禁止它的选项/etc/ssh/sshd_config:
# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes
Run Code Online (Sandbox Code Playgroud)
有没有办法将此配置应用于选定的 IP 地址范围?
我尝试按照此处的说明进行操作:http : //lani78.wordpress.com/2008/08/08/generate-a-ssh-key-and-disable-password-authentication-on-ubuntu-server/
只允许在服务器上使用公钥的用户进行身份验证,但我无法让 SSH 禁止仅使用用户名/密码登录。
这是我的 sshd_config 文件 - 我错过了什么吗?我已经尝试重新启动 SSH 和计算机本身。
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size …Run Code Online (Sandbox Code Playgroud) 我正在使用 Ubuntu 11.10。我ssh每天都用于连接许多服务器,所以我将它们的参数放在.ssh/config文件中,如下所示:
Host Home
User netmoon
Port 22
HostName test.com
Run Code Online (Sandbox Code Playgroud)
有没有办法将每个连接的密码放在这个文件中,这样,当服务器要求输入密码时,终端输入其密码并将其发送到服务器?
我需要这个,因为有时我远离电脑,当我回去时,输入密码并按Enter终端说CONNECTION CLOSED。
PS 我不想使用公钥/私钥对。
我习惯于在 Windows 机器上或 OSX 命令行终端上使用 Putty SSH 到 NAS,而无需对客户端进行任何配置。
Ubuntu 16.04 尝试通过 SSH 连接到 NAS(通过 LAN):
ssh root@192.168.8.109
Unable to negotiate with 192.168.8.109 port 22: no matching host key type found. Their offer: ssh-dss
Run Code Online (Sandbox Code Playgroud)
我在虚拟机中有一个 12.10 服务器设置,其网络设置为桥接(基本上将被视为连接到我的交换机的计算机)。
我通过安装 opensshdapt-get并且能够使用我的用户名和密码使用腻子连接到服务器。
然后我开始尝试让它使用公钥/私钥身份验证。我做了以下事情:
/etc/ssh/myusername/authorized_keys(我正在使用加密的主目录)。sshd_config像这样设置:
PubkeyAuthentication yes
AuthorizedKeysFile /etc/ssh/%u/authorized_keys
StrictModes no
PasswordAuthentication no
UsePAM yes
Run Code Online (Sandbox Code Playgroud)当我使用 Putty 或 WinSCP 进行连接时,我收到一条错误消息,提示没有可用的支持的身份验证方法(服务器发送了公钥)。
如果我sshd在调试模式下运行,我会看到:
PAM: initializing for "username"
PAM: setting PAM_RHOST to "192.168.1.7"
PAM: setting PAM_TTY to "ssh"
userauth-request for user username service ssh-connection method publickey [preauth]
attempt 1 failures 0 [preauth]
test whether pkalg/pkblob are acceptable [preauth[
Checking blacklist file /usr/share/ssh/blacklist.RSA-1023
Checking blacklist file /etc/ssh/blacklist.RSA-1023
temporarily_use_uid: 1000/1000 (e=0/0)
trying …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用命令行 ssh 连接将文件夹复制到远程 Ubuntu 服务器,我知道使用 scp 传输文件是可行的,但我试图复制到该远程服务器的文件夹中有很多文件,这是如何完成的?任何人?谢谢你。
我得到一个
port 22: Connection refused
Run Code Online (Sandbox Code Playgroud)
连接到服务器时出错。
我已经安装了 openssh 客户端和服务器,并且它们正在运行。但是还是有错误。请帮忙。