Shell,bash,git Bash,xshell,ssh

Source: Internet
Author: User
Tags auth shell account

One: The shell is the shell of the Linux/unix system, and it can be understood as the command line interface, where you enter and execute the command line.

Bash (born again shell) is one of the shell's most commonly used shells.  you run on your Linux: PS | grep $$; If you run the result as bash, it means that the current default shell is bash.  The shell is basically a command interpreter, similar to the commands under DOS. It receives user commands (such as LS, etc.),

Then call the appropriate application. The more general Shell has the standard Bourne shell (SH) and C shell (CSH).  Two: Xshell a powerful security terminal simulation software under the Windows platform. Xshell is not related to the shell, Xshell is a tool for SSH connections under Windows,

Similar software also has secure-crt,putty and so on. Linux like Ubuntu has built-in SSH connection tool ssh-agent.

Three:

http://code.google.com/p/msysgit/ git bash is a command-line tool under Windows. ["Self-Understanding: Git bash is a small Linux system under Windows, with the built-in SSH connection tool"] based on the Msys GNU environment, there is a GIT distributed version Control tool that is also used primarily for git.  The GNU environment, which means you can choose to use Git bash if you like the Linux/unix environment.  There are familiar with your Linux tools, Tar,grep,awk, etc., and can install the compilation environment Gcc,make and so on.  can refer to msys:http://baike.baidu.com/view/371287.htm mingw:http://baike.baidu.com/view/98554.htm msysgit:http://code.google.com/p/msysgit/  Four: a Good article

Http://www.111cn.net/sys/linux/55152.htm



Linux implementation using SSH telnet Server details www.111cn.net edit: kp12345 Source: Reproduced in linux login server has telnet and ssh two ways, let me introduce the built in Ubuntu SSH Login Server method, Currently the most secure remote connection server is also using SSH


Telnet and ssh two ways, because Telnet uses the plaintext transmission, the transmission process of important information such as System account password is easy to intercept, security than SSH (Secure shell), so now generally use SSH as a remote login tool.



In fact, many Linux versions such as Ubuntu have built-in ssh-agent, this is a remote connection tool, through the ssh-agent can initiate remote connection, but if you want to implement the other computer telnet to their own computer, you must install OpenSSH, you can use the following command
Ubuntu


The code is as follows
sudo apt-get install OpenSSH


ArchLinux


The code is as follows
sudo pacman-s openssh


The system will automatically download and complete the installation, and after completion, you can check whether the SSH service is started by following command


The code is as follows
Ps-ef | grep sshd


If there is no sshd this process, manually start
Ubuntu


The code is as follows
Sudo/etc/init.d/ssh start


ArchLinux


The code is as follows
Sudo/etc/rc.d/sshd start


ArchLinux add sshd to daemons array boot up



daemons= (Syslog-ng network crond dbus alsa @openntpd sshd)
If the sshd process occurs, it means that the SSH service has started, it is not an accident that you can connect to your computer via SSH on another computer. For the SSH connection tool, the Windows platform recommended SECURE-CRT software, which is a very popular software, the use is relatively simple. Can also choose putty, but it is recommended to download the official English version, a period of time the Chinese version of the Putty have the back door of the matter in the online speculation. Linux system because it has ssh-agent, so it is convenient to enter the following command directly in the terminal



SSH [email protected]
Username is your login account, IP is IP address, of course you can also use the domain name



SSH [email protected]
You will be asked to enter a password to verify that you can log on to the remote host. For security reasons, you need to make some simple configuration, otherwise you will see a large number of IP logon failure information when you view the SSH log file later. In fact, someone else through the port scanning software scanning to open the (SSH default) port of the host, and then through the poor lifting method for password guessing, if you use a weak password, the probability of being guessed is very high.



Configuration file path



Ubuntu


The code is as follows
/etc/ssh/ssh.conf


ArchLinux


The code is as follows
/etc/ssh/sshd.config


We can configure this file by editing it. When you try to log in to someone else's console, what are you logged in? The root user, of course, because root is a user of every Linux system. So we should disable the root user login to find


The code is as follows
Permitrootlogin Yes


Change Yes to No.



The port scan software scans 22 ports by default, so we can also change the port to another port and find the following statement



Port 22
Change 22 of them to your other ports, such as 1022.



Limit the maximum number of password errors, 3 times, your own login basic will not be 3 consecutive errors, password error more than 3 denied login



Maxauthtries 3
Save exit after modification, restart SSH service



Ubuntu


The code is as follows
Sudo/etc/init.d/ssh restart


ArchLinux


The code is as follows
Sudo/etc/rc.d/sshd restart


Note that you need to declare the port when you log in with CLI mode after modifying the port


The code is as follows
Ssh-p 1022 [email protected]


With a simple configuration you will notice a noticeable decrease in failed logins from unknown IP. Forgot to say that the SSH login log is saved in this file


The code is as follows
/var/log/auth.log


Under ArchLinux the owner of this file is root, the group is log, the permission is 640, in order to facilitate the normal user to view the log, add the user to the log group (not recommended others and permissions)


The code is as follows
sudo gpasswd-a song log


Usually can cat this file to look at the login record, of course, sometimes the file will be longer, especially before the root user is not disabled, often from the same IP login failed to reach thousands of, if you line to see what time, so we only output the root log failed record ( Although root login is disabled, the system will still log when someone tries to log on as root)


The code is as follows
grep "Failed password for root"/var/log/auth.log | awk {' Print $11 '} | uniq-c | Sort-rn


The system will list the IP that has failed to log in and count the number of failures from high to the bottom, of course, you can also enter a record of successful login


The code is as follows
grep "Accepted password for"/var/log/auth.log


The system will list the records that have been logged on to the host, including time, IP address, etc.



In addition, I am using the Android phone, using the kernel of Linux, so I would like to be able to telnet to their own computer from the phone. First, the mobile phone installed support SSH connection software, CYANOGENMOD7 version of the system comes with a terminal, is simply a miniature Linux terminal, basically a lot of basic instructions can be executed, such as: Ls,cd,mount,cat,nano and so on. Then there is a problem, I am using the telecommunications ADSL, through the Tp-link Router PPPoE dial-up Internet, each dial to obtain the same IP, this is not SSH login, because you do not know the next time to obtain the IP address is how much. So think of Windows Peanut Shell client, can dynamically resolve the domain name, hurried to the Peanut shell website to apply for a free domain name, but at that time did not release Linux client (now have source installation), vaguely seem to remember tp-link has dynamic DNS function, login up sure, In the dynamic DNS service provider selected peanut shell, account password to fill the Peanut Shell website account password, log on will be the Peanut Shell account binding domain name to the local, but when you through the domain name SSH connection is not connected, because dial-up Internet is the router, peanut shell will be the domain name to your router, Instead of your computer, so make further settings. In the Tp-link Router Settings page forwarding rules to select the DMZ host, the DMZ state setting enabled, the DMZ host IP address to fill you from the router DHCP server to obtain IP, if your router compared to more people on the Internet may each time from the DHCP IP is not the same, So to put your host MAC address and an IP address binding, that is, to keep an IP address to your network card, so that every time you get the same IP, this IP address is filled in the DMZ host IP address. And then use the domain name to SSH connection discovery has been able to link the normal.



Finally put on a few mobile phones Telnet host successfully after the



Welcome to Ubuntu






root directory






ll view file properties







Shell,bash,git bash,xshell,ssh


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.