Guide to Connecting to Your Application Using SSH/SFTP
文章推薦指數: 80 %
It is a file transfer protocol such as FTP yet operates over a secure network ... on the Cloudways Platform that you can use to connect to your application. AllCollections AdministeringServerandWebsite ConnectingtoApplicationRemotely GuidetoConnectingtoYourApplicationUsingSSH/SFTP GuidetoConnectingtoYourApplicationUsingSSH/SFTP P WrittenbyProductSupport Updatedoveraweekago Therearedifferentwaystoconnecttoyourapplicationremotely,somemoresecurethanothers.TwosecuremethodswhichweliketouseourselvesareSecureShell(SSH),andSecureFileTransferProtocol(SFTP).BothmethodsaresupportedoverallourserverplansincludeSSHandSFTPaccess.VideoTutorial—HowtoConnectviaSSHonWindowsVideoTutorial—HowtoConnectviaSFTPonWindowsWhatisSSH?SecureShellprovidesstrongauthenticationandencrypteddatacommunicationsbetweentwocomputersorserversconnectingoveranopennetworksuchastheinternet.Thismeansthatanydeviceinthemiddleisunabletodecipherthecommunicationbecauseonlyyourenddevice/serverisabletodecrypttheinformationexchange.TipYoucanalsorunadditionaltoolssuchasComposer,Git,WP-CLIforWordPress,anddatabasequeriesusingSSH.WhatisSFTP?SFTPstandsforSecureFileTransferProtocol(alsoknownasSSHFileTransferProtocol).ItisafiletransferprotocolsuchasFTPyetoperatesoverasecurenetworkprotocollikeSSH.WehighlyrecommendusingSFTPforfiletransferringbecause:Itaddsalayerofsecurity.Transferreddataisencrypted,soitisnotsentincleartext.HowtoConnecttoYourApplicationUsingSSH/SFTPPrerequisitesToconnecttoyourserverorapplicationusingSSH,youwillneedthefollowing:MasterusernameorApplicationusername.PasswordPublicIPaddress(alsoknownasServerIP)WewillhelpyoulocatethisinformationonyourCloudwaysPlatforminthenextsteps.PleasenotethattheMasteruserhasSSHaccessenabledbydefault;however,youneedtomanuallyenableSSHaccessfortheapplicationuser(s).SSH/SFTP—AccessingtheCredentialsTherearetwotypesofcredentials(MastercredentialsandApplicationcredentials)ontheCloudwaysPlatformthatyoucanusetoconnecttoyourapplication.Usually,teammembersareprovidedwithapplicationcredentialsbythewebsiteowner.So,whichcredentialswillyoubeusing?ImportantIfyouareusingMicrosoftWindowsyouwilleitherneedtoenableWLS(WindowsLinuxSubsystem)orelseuseafreethird-partytoolsuchasPuTTY.Alternatively,youcanalsousethebuilt-inSSHTerminalofCloudwaysPlatform.YouneedanSFTPclienttoconnecttoyourserverremotely.Inthisdemonstration,weareusingafreethird-partytoolcalledFileZilla,whichisavailableonWindowsandmacOS,butyoucanalsouseanyotherclient.Pleasemakesuretodownloadsuchtoolsonlyfromtheirofficialwebsitetoalwaysgetthelatestavailableversion.UsingMasterCredentialsLogintoyourCloudwaysPlatformusingyouremailaddressandpassword.Fromthetopmenubar,openServers.Then,choosetheserveryouwishtoconnect.3.UnderServerManagement,youcanfindyourPublicIPaddress,username,andpassword.Besuretotakenoteofit.TipClickoncredentialstocopyitontheclipboard.UsingApplicationCredentialsLogintoyourCloudwaysPlatformusingyouremailaddressandpassword.Fromthetopmenubar,openServers.Then,chooseyourserverwhereyourdesiredapplicationisdeployedtoviewapplicationcredentials.3.Next,clickwww.4.Chooseyourdesiredapplication’sname.5.UnderApplicationCredentials,youcanfindyourPublicIPaddress,applicationusername,andpassword.Besuretotakenoteofit.TipClickoncredentialstocopyitontheclipboard.Iftherearenocredentials,thenyoucancreateapplicationcredentials.Below,youwillfindinformationaboutinitiatingconnectionsusingSSHandSFTPseparately.SSH(MicrosoftWindows)—InitiatingConnectionLaunchPuTTYclientandenteryourHostname(ServerPublicIPaddress).InputPort22,whichisalsothestandardTCPportforSSH.ClickOpen.4.YoumayseeanRSA2keypromptifthisisyourfirsttimeconnectingtotheserver.ClickYestomakethisatrustedhostforfutureconnections.SSH(MicrosoftWindows)—LoggingintoServerHere,youneedtoinputyourmasterorapplicationusername,whichyoupreviouslynoted.TipTopastethecopieditemintheterminal,tapright-clickonce.Theterminalscreenwillonlyworkwitharrowkeysfornavigation,notwithamouse.2.Next,inputyourpassword.Pleasenotethatnocharacterwillappearasyoutypethepasswordduetosecurityreasons.3.YouarenowconnectedtoyourserverviaSSH.Now,youcanruncommandssuchaslstolistandnavigateyourfilesanddirectories.ImportantIfyouareusingtheMasterCredentials,youwillneedtobrowsetoyourtargetapplicationfolder.IfyouareusingtheApplicationCredentials,youwilllanddirectlyintherespectiveapplicationfolder.SSH(Linux/macOS)—LoggingintoServerWewon’trequireanyexternalSSHclientforLinux/macOS,althoughyouarefreetodosoifyoualreadyhavesomepreferred3rdpartyapplication.Inthisexample,weareusingLinux(Ubuntu).Openyourterminalandexecutethefollowingcommand.Usernamereferstoamasterusernameorapplicationusername,andthehostnameisyourServerPublicIPaddress.Bydefault,theSSHconnectionisinitiatedusingport22.sshusername@hostExample:[email protected]:youcanalsopointyourSSHclienttowhichprivatekeyshouldbeusedbyusingthe-iidentityswitchasfollows:ssh-i~/.ssh/id_rsamaster_ojnokgldl@192.168.0.1TipTheterminalscreenwillonlyworkwitharrowkeysfornavigation,notwithamouse.2.YoumayseeanRSAkeypromptifthisisyourfirsttimeconnectingtotheserver.Typeyestomakethisatrustedhostforfutureconnections.3.Next,inputyourpassword.Pleasenotethatyourpasswordwillnotbecomevisibleduetosecurityreasons.4.YouarenowconnectedtoyourserverviaSSH.Now,youcanruncommandssuchaslstolistandnavigateyourfilesanddirectories.ImportantIfyouareusingtheMasterCredentials,youwillneedtobrowsetoyourtargetapplicationfolder.IfyouareusingtheApplicationCredentials,youwilllanddirectlyintherespectiveapplicationfolder.PleasenotethatSSHisapotenttool,andadvancedusersuseit.Executingwronginstructionsmaybreakyourwebsiteanddeletethecriticalfiles;therefore,werecommendusingitwithextracareandalwaystakeabackupoftheapplicationyouareworkingonortakeawholeserverbackupalwaystorestoreifneeded.SFTP—InitiatingConnectionLaunchFileZillaclientandentersftp://server-ip-addressinHost.Bywritingsftp://,youareensuringthattheSFTPconnectionisformed.Youneedtoinputyourmasterorapplicationusername,whichyoupreviouslynoted.Next,inputyourpassword.SetPort22.Finally,clickQuickConnect.6.YouarenowconnectedtoyourserverviaSFTP.Now,youcandraganddropfilesandfoldersbetweenyourpersonalcomputerandyourserver.ImportantIfyouareusingtheMasterCredentials,youwillneedtobrowsetoyourtargetapplicationfolder.IfyouareusingtheApplicationCredentials,youwilllanddirectlyintherespectiveapplicationfolder.Ifyoufaceanypermission-relatedissues,thenyoucanalsoresetyourfileandfolderpermissions.That’sit!Wehopethistutorialwashelpful.Ifyouneedanyhelp,thenfeelfreetosearchyourqueryonCloudwaysSupportCenterorcontactusviachat(NeedaHand>SendusaMessage).Alternatively,youcanalsocreateasupportticket. Didthisansweryourquestion?
延伸文章資訊
- 1How to Access WordPress Files with Cloudways - SFTP Setup
- 2效能CP值兼具!Cloudways主機架設WordPress網站教學
Coludways FTP 使用方法
- 3如何使用FTP軟體連結到Cloudways | 北方羽林
在Cloudways的後台中可以直接觀看資料庫,不過如果要管理各式資料,還是FTP方便不少,那要怎麼...
- 4Cloudways 主機介紹與實戰筆記|架設WordPress 網站
如何建立成員用的FTP? 在Application Credentials 中,新增Username 和Password 後點擊ADD 新增即可。設定路徑:Applications > Appl...
- 5Guide to Connecting to Your Application Using SSH/SFTP
It is a file transfer protocol such as FTP yet operates over a secure network ... on the Cloudway...