انجمنهای فارسی اوبونتو
کمک و پشتیبانی => شبکه و سرویس دهندهها => نویسنده: بهروز رمضانی در 06 آذر 1392، 08:14 بظ
-
طبق فرمایش جناب nixoeen از تل نت اومدم روی ssh . طبق این راهنما عمل کردم
http://www.cyberciti.biz/faq/centos-ssh/
اما زمانی که با دستور
ssh 192.168.56.102
قصد لاگین به سرور را دارم . ازم پسورد میخواد . روی سرور یک کابر به نام behrooz دارم با پسورد 123 و کاربر root با پسورد 142536 . خود ssh با کاربر behrooz قصد لاگین را داره اما پسورد را قبول نمیکنه . این خروجیش .
behrooz@behrooz-VirtualBox:~$ ssh 192.168.56.102
behrooz@192.168.56.102's password:
Permission denied, please try again.
behrooz@192.168.56.102's password:
Permission denied, please try again.
behrooz@192.168.56.102's password:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
دستور
ssh -v -v -v behrooz@192.168.56.102
اینم خروجیش
behrooz@behrooz-VirtualBox:~$ ssh -v -v -v behrooz@192.168.56.102
OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.56.102 [192.168.56.102] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/behrooz/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /home/behrooz/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/behrooz/.ssh/id_rsa-cert type -1
debug1: identity file /home/behrooz/.ssh/id_dsa type -1
debug1: identity file /home/behrooz/.ssh/id_dsa-cert type -1
debug1: identity file /home/behrooz/.ssh/id_ecdsa type -1
debug1: identity file /home/behrooz/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "192.168.56.102" from file "/home/behrooz/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/behrooz/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-dss-cert-v00@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 120/256
debug2: bits set: 517/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 37:d1:a3:13:c4:19:47:96:b3:29:3b:29:09:f9:fb:af
debug3: load_hostkeys: loading entries for host "192.168.56.102" from file "/home/behrooz/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/behrooz/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug1: Host '192.168.56.102' is known and matches the RSA host key.
debug1: Found key in /home/behrooz/.ssh/known_hosts:1
debug2: bits set: 500/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/behrooz/.ssh/id_rsa (0x2195c878)
debug2: key: /home/behrooz/.ssh/id_dsa ((nil))
debug2: key: /home/behrooz/.ssh/id_ecdsa ((nil))
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup gssapi-keyex
debug3: remaining preferred: gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-keyex
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug2: we did not send a packet, disable method
debug3: authmethod_lookup gssapi-with-mic
debug3: remaining preferred: publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
Cannot determine realm for numeric host address
debug1: Unspecified GSS failure. Minor code may provide more information
Cannot determine realm for numeric host address
debug1: Unspecified GSS failure. Minor code may provide more information
debug1: Unspecified GSS failure. Minor code may provide more information
Cannot determine realm for numeric host address
debug2: we did not send a packet, disable method
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/behrooz/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /home/behrooz/.ssh/id_dsa
debug3: no such identity: /home/behrooz/.ssh/id_dsa
debug1: Trying private key: /home/behrooz/.ssh/id_ecdsa
debug3: no such identity: /home/behrooz/.ssh/id_ecdsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
behrooz@192.168.56.102's password:
debug3: packet_send2: adding 64 (len 55 padlen 9 extra_pad 64)
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
از داخل ویندوز هم همین طور برای هر دو کاربر ارور روی پسورد میده .
-
قسمت AllowUsers behrooz رو توی تنظیمات SSH گذاشتی؟
-
قسمت AllowUsers behrooz رو توی تنظیمات SSH گذاشتی؟
محتویات فایل پیکره بندی ssh
# $OpenBSD: sshd_config,v 2.80 2008/07/02 02:24:18 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
allowusers behrooz
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
# Disable legacy (protocol version 1) support in the server for new
# installations. In future the default will change to require explicit
# activation of protocol 1
Protocol 2
حروف کوچیک و بزرگ با هم فرق میکنن
allowusers behrooz
AllowUsers behrooz
-
حروف کوچیک و بزرگ با هم فرق میکنن
این الان جمله خبری بود؟ یا سوالی بود؟!
-
حروف کوچیک و بزرگ با هم فرق میکنن
این الان جمله خبری بود؟ یا سوالی بود؟!
سوالی بود . حالا سوال اینه :
ایا کوچک و بزرگ بودن حروف در فایل پیکرهبندی ssh تاثیری در عملکرد این سرویس دارد ؟
-
(note that keywords are case-insensitive and arguments are case-sensitive)
از این لینک (http://linux.die.net/man/5/ssh_config)
-
جناب nixoeen شرمنده مزاحم وقت شما هم شدم . حرف اول نام کاربری را باید بزرگ مینوشتم ، اشتباه از طرف من بود . اما یه سوال در حالت اول که دستور را به همراه نام کاربری اجرا میکنم ارتباط برقرار میشه .
ssh Behrooz@192.168.56.101
اما بدون نام کاربری
ssh 192.168.56.101
خود بخود با یوزر behrooz میخواد لاگین کنه که نمیتونه . مگر نه اینکه پس از درخواست اتصال بایستی از کاربر بخواد با چه یوزری میخواد به سرور لاگین کنه . مثل برنامه putty در ویندوز . این برنامه را روی ویندوز ایکس پی اجرا کردم . اون اولش درخواست نام کاربری کرد و بعد پسورد و در انتها هم لاگین شد .
-
اگر نام کاربر را ننویسید میکوشد با نام کاربر کنونی وصل شود
اینجا ویندوز نیست
-
مگر نه اینکه پس از درخواست اتصال بایستی از کاربر بخواد با چه یوزری میخواد به سرور لاگین کنه .
دوست من، وقتی یک جمله سوالی هست لطفا در انتها علامت سوال بذارید. وقتی هیچی نمیذارید یا نقطه میذارید، واقعا معلوم نیست که دارید جمله خبری میگید یا دارید انتقاد میکنید یا ...!
-
جناب nixoeen شرمنده مزاحم وقت شما هم شدم . حرف اول نام کاربری را باید بزرگ مینوشتم ، اشتباه از طرف من بود . اما یه سوال در حالت اول که دستور را به همراه نام کاربری اجرا میکنم ارتباط برقرار میشه .
ssh Behrooz@192.168.56.101
اما بدون نام کاربری
ssh 192.168.56.101
خود بخود با یوزر behrooz میخواد لاگین کنه که نمیتونه . مگر نه اینکه پس از درخواست اتصال بایستی از کاربر بخواد با چه یوزری میخواد به سرور لاگین کنه . مثل برنامه putty در ویندوز . این برنامه را روی ویندوز ایکس پی اجرا کردم . اون اولش درخواست نام کاربری کرد و بعد پسورد و در انتها هم لاگین شد .
در ترمینال پسورد پرسیده نمیشه. پس وقتی نزارینش با همون یوزری که ترمینالتون مطعلق بهش هست که دارین باهاش ssh میزنین سعی میکنه کانکت بشه .
البته putty رو با wine میتونین احرا کنین یک putty هم در مخازن موحود هست .
-
جناب nixoeen شرمنده مزاحم وقت شما هم شدم . حرف اول نام کاربری را باید بزرگ مینوشتم ، اشتباه از طرف من بود . اما یه سوال در حالت اول که دستور را به همراه نام کاربری اجرا میکنم ارتباط برقرار میشه .
ssh Behrooz@192.168.56.101
اما بدون نام کاربری
ssh 192.168.56.101
خود بخود با یوزر behrooz میخواد لاگین کنه که نمیتونه . مگر نه اینکه پس از درخواست اتصال بایستی از کاربر بخواد با چه یوزری میخواد به سرور لاگین کنه . مثل برنامه putty در ویندوز . این برنامه را روی ویندوز ایکس پی اجرا کردم . اون اولش درخواست نام کاربری کرد و بعد پسورد و در انتها هم لاگین شد .
در ترمینال پسورد پرسیده نمیشه. پس وقتی نزارینش با همون یوزری که ترمینالتون مطعلق بهش هست که دارین باهاش ssh میزنین سعی میکنه کانکت بشه .
البته putty رو با wine میتونین احرا کنین یک putty هم در مخازن موحود هست .
متوجه شدم مشکل کجا بود ، در واقع با یوزر کلاینت میخواسته به سرور وصل بشه . راجع به putty ، این برنامه را روی یه ویندوز مجازی تست کردم که بدونه مشکل وصل شد . اما یه سوال :
ایا برای مدیریت یک سرور از راه دور فقط ابزار ssh را داریم یا روشهای دیگهای هم هست ؟
-
ssh برای مدیریت نیست .ssh برای متصل شدن به ترمینال سرور هستش که از طریق ترمینال میتونین سرور رو مدریت کنین . روش های دیگم برای وصل شدن به ترمینال هست . کنترل پنل هم برای مدیریت سرور هست مثل zentyal webmin ispconfig
-
ssh برای مدیریت نیست .ssh برای متصل شدن به ترمینال سرور هستش که از طریق ترمینال میتونین سرور رو مدریت کنین . روش های دیگم برای وصل شدن به ترمینال هست . کنترل پنل هم برای مدیریت سرور هست مثل zentyal webmin ispconfig
ممنون