{"id":1778,"date":"2021-09-09T13:50:55","date_gmt":"2021-09-09T13:50:55","guid":{"rendered":"https:\/\/ownwebservers.com\/kb\/?p=1778"},"modified":"2021-09-09T14:12:21","modified_gmt":"2021-09-09T14:12:21","slug":"secure-shellssh-commands-for-linux-administration","status":"publish","type":"post","link":"https:\/\/ownwebservers.com\/kb\/secure-shellssh-commands-for-linux-administration\/","title":{"rendered":"Secure Shell(SSH) Commands for Linux administration."},"content":{"rendered":"<p>A shell is nothing however a script that is written for the shell, or command interpreter, of anoperating system. it&#8217;s also considered as a simple domain-specific programming language that embodys totally different typical operations performed by shell scripts that include file manipulation, program execution, and printing text. In numerous terms shell is additionally named as a term for user interface, in operation systems and applications to produce an alternate shell interface to form interaction with the program easier. In simple terms if the applying is sometimes command driven, the shell may be a menu-driven system that interprets the user\u2019s alternatives into the suitable commands.<\/p>\n<h2><strong>Lets see some basic Shell Commands for Linux administration<\/strong><\/h2>\n<p>passwd : This command will make changes to your SSH account\u2019s password, you just have to follow the options after typing change account password.<br \/>\nnano [option] [file]: This is a File editor, easy-to-use and very friendly.<br \/>\nnano \u2013w \/home\/aquhome\/public_html\/index.php : your current editing<\/p>\n<p>index.php with \u2013w being non wrapping of long lines<\/p>\n<p>mkdir [directory_name] : Used to create a directory with specific default permissions .<\/p>\n<p>mkdir aquhome : Creates a directory aquhome in the current directory you are.<\/p>\n<p>df : [attribute]<\/p>\n<p>[b]df -h[b] : It is to show you the disk space available in human readable format (Mbit and Gbit)<\/p>\n<p>cd : change directory<br \/>\ncd ~ : takes to your home directory<br \/>\ncd \u2013 : takes to the last directory you viewed<br \/>\ncd ..\/ : takes you one level up a directory<br \/>\ncd [directory path]<br \/>\ncd \/home\/aqhome\/public_html<\/p>\n<p>ls: This command lists files and directories in a directory.<\/p>\n<p>ls \u2013l : It will show all the files with detailed attributes.<\/p>\n<p>vi : This commnad is used for advanced editor, having tons of features, but harder to use then nano<\/p>\n<p>vi \/home\/aquhome\/public_html\/index.php : Editing that index.php file again<\/p>\n<p>ln : Makes sys links between the files and directories<\/p>\n<p>ln \u2013s \/usr\/local\/apache\/conf\/httpd.conf \/etc\/httpd.conf : This command will allow you to edit the \/etc\/httpd.conf instead of the original, changes will apply to the original immediately. You can delete the link without deleting the original.<\/p>\n<p>wall : broadcast message<br \/>\nwall [message]<br \/>\nwall so whens the server being restarted?<br \/>\ntop : It will shows endlessly updating system processes in a table.<br \/>\nw : Displays\u00a0 ip address of the person and who has logged in currently.<br \/>\nps : Displays the processes that are running.<br \/>\ntouch : creates an empty file.<br \/>\ntouch [file]<br \/>\ntouch index.html : creates an empty index.html<br \/>\nkill : terminates a particular system process<br \/>\nkill -9 [PID] : You can get a PID by using Top.<br \/>\nkill -9 100545<br \/>\ncp : Used to copy a file<br \/>\ncp yourfile yourfile.copy : It will copies yourfile data\u00a0 to yourfile.copy<br \/>\ncp \u2013a \/home\/aquhome\/public_html\/* \/home\/aquhome\/public_ftp\/ : It is used to copies all files in public_html to \/public_ftp<br \/>\ndu : displays disk usage<br \/>\ndu \u2013sh : displays a summary of total disk space in the current directory along with the subdirectories in human readable form<br \/>\nnetstat : displays all current network connections<br \/>\nnetstat -rn : displays routing tables for IP\u2019s.<br \/>\nnetstat -an : displays all connections to the server.<br \/>\nchown : command to change the owner of a file<br \/>\nchown [attribute] newowner.newowner filenames<br \/>\nchown -R aquhome.aquhome \/home\/aquhome\/public_html\/index.php<br \/>\nchmod : [-r] permissions filenames<\/p>\n<p>Permissions :<br \/>\nu \u2013 A User who owns the file.<br \/>\ng \u2013 A Group that owns the file.<br \/>\no \u2013 Other.<br \/>\na \u2013 All.<br \/>\nr \u2013 Reads the file.<br \/>\nw \u2013 Writes or edit the file.<br \/>\nx \u2013 Executes or run the particular file as a program.<\/p>\n<p>Numeric Permissions:<br \/>\nCHMOD can also be attributed by using Numeric Permissions:<br \/>\n400 read by owner<br \/>\n040 read by group<br \/>\n004 read by anybody (other)<br \/>\n200 write by owner<br \/>\n020 write by group<br \/>\n002 write by anybody<br \/>\n100 execute by owner<br \/>\n010 execute by group<br \/>\n001 execute by anybody<br \/>\nCHMOD 755 \/home\/aquhome\/public_html\/index.php<br \/>\nlast : shows last logins to the system<br \/>\nrm : deletes a file<br \/>\nrm filename.txt : deletes filename.txt, will more than likely ask, if you really wish to delete it<br \/>\nrm -f filename.txt : deletes filename.txt, won\u2019t ask for confirmation before deleting.<br \/>\nrm -rf tmp\/ : recursively deletes the directory tmp, and all files in it. You need to be very carefull with this command.<br \/>\ngrep : Search for patterns in files<br \/>\ngrep root \/etc\/passwd : displays all matches of root in \/etc\/passwd<br \/>\ngrep -v root \/etc\/passwd : displays all lines that don\u2019t match root<br \/>\nwc : word count<br \/>\nwc -l filename.txt : shows how many lines are in filename.txt<br \/>\nmv : Moves a specific file.<br \/>\nmv -f \/home\/pen\/ram.php \/root\/\u00a0 moves\u00a0 ram.php to the directory root<\/p>\n<p>Basic Extracting Commands:<br \/>\ntar xvfz imagick-0.9.11.tgz : will extracts the .tgz file<br \/>\nbzip2 and bunzip: files with .bz2 extensions<br \/>\nbzip2 filename.txt : zips filename.txt to filename.txt.bz2<br \/>\nbunzip2 filename.txt.bz2 : unzips filename.txt.bz2 to filename.txt<\/p>\n<p>Essential Service Commands:<br \/>\nservice httpd restart : Restarts Apache<br \/>\nservice mysql restart : Restarts MySQL<br \/>\nservice exim restart : Restarts exim<br \/>\nservice cpanel restart : Restarts Cpanel<\/p>\n<p>The technical team working at Ownwebservers deploys qulaity tech services with quick response to solve any problem. Ownwebservers also offers quality hardware and highly configurable Dedicated server with disaster recovery plans to host any small or large website with different technologies like VPS servers, Cloud hosting\u00a0server to host your website with quick setup server guarantee and no downtime.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A shell is nothing however a script that is written for the shell, or command interpreter, of anoperating system. it&#8217;s also considered as a simple domain-specific programming language that embodys totally different typical operations performed by shell scripts that include file manipulation, program execution, and printing text. In numerous terms shell is additionally named as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-1778","post","type-post","status-publish","format-standard","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v15.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Secure Shell(SSH) Commands for Linux administration. - OWS KB<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ownwebservers.com\/kb\/secure-shellssh-commands-for-linux-administration\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Secure Shell(SSH) Commands for Linux administration. - OWS KB\" \/>\n<meta property=\"og:description\" content=\"A shell is nothing however a script that is written for the shell, or command interpreter, of anoperating system. it&#8217;s also considered as a simple domain-specific programming language that embodys totally different typical operations performed by shell scripts that include file manipulation, program execution, and printing text. In numerous terms shell is additionally named as [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ownwebservers.com\/kb\/secure-shellssh-commands-for-linux-administration\/\" \/>\n<meta property=\"og:site_name\" content=\"OWS KB\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-09T13:50:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-09T14:12:21+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\">\n\t<meta name=\"twitter:data1\" content=\"admin\">\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data2\" content=\"4 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"OWS KB\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/ownwebservers.com\/kb\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/secure-shellssh-commands-for-linux-administration\/#webpage\",\"url\":\"https:\/\/ownwebservers.com\/kb\/secure-shellssh-commands-for-linux-administration\/\",\"name\":\"Secure Shell(SSH) Commands for Linux administration. - OWS KB\",\"isPartOf\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\"},\"datePublished\":\"2021-09-09T13:50:55+00:00\",\"dateModified\":\"2021-09-09T14:12:21+00:00\",\"author\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\"},\"breadcrumb\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/secure-shellssh-commands-for-linux-administration\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ownwebservers.com\/kb\/secure-shellssh-commands-for-linux-administration\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/secure-shellssh-commands-for-linux-administration\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/secure-shellssh-commands-for-linux-administration\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/secure-shellssh-commands-for-linux-administration\/\",\"name\":\"Secure Shell(SSH) Commands for Linux administration.\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/ownwebservers.com\/kb\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/comments?post=1778"}],"version-history":[{"count":2,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1778\/revisions"}],"predecessor-version":[{"id":1780,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1778\/revisions\/1780"}],"wp:attachment":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/media?parent=1778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/categories?post=1778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/tags?post=1778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}