New SSH key for a new different user | DigitalOcean (2024)

DigitalOcean
    • Log in to:
    • Community
    • DigitalOcean
    • Sign up for:
    • Community
    • DigitalOcean

Question

  • Posted on September 19, 2017
  • Linux BasicsUbuntu 16.04
  • New SSH key for a new different user | DigitalOcean (1)Asked by Mehmet Can Ertan

Hi everyone.

I have a my droplet with SSH key and it works properly. I created a new user in this droplet. I want to create a new SSH key for this new user. I will use this user for my php website. So, this new ssh key must be different from the root user key. How can I do that?

I’ve been doing a lot of research. But I could not find something that works.

You should be clear on the answers you provide. Because my english is not good. Thanks.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Mouhsen IbrahimSeptember 19, 2017

Accepted Answer

@TLod

Almost the same steps as before:

  • Generate a key pair using puttygen save the private key to your hard disk.
  • Copy the public key then log in to your droplet as root switch to your user su user then create a directory called .ssh in your home directory and create a file inside it called .authorized_keys and paste the public key there.
  • Open putty enter your droplet IP then browse to SSH -> auth then choose Browse... and open your private key which you saved before.
  • Open Connection -> data and enter your user name in Auto-login username
  • Go back to Session choose a name for your session and choose save now you can connect.

Hope this helps.

Mouhsen IbrahimSeptember 19, 2017

@TLod

  • You need to create a new ssh key pair using ssh-keygen BUT BE CAREFUL to change the name of the private key to something different that ~/.ssh/id_rsa, you can call it ~/.ssh/id_user_rsa.

  • Upload your new public key to the server with this command ssh-copy-id -i ~/.ssh/id_user_rsa user@droplet_ip, you will be prompted for your new user’s password here.

  • Then when you want to connect to your droplet using your new user use this command ssh -i ~/.ssh/id_user_rsa user@droplet_ip

Hint: if you need to create a shortcut you can use this file ~/.ssh/config add this content to it

Host user_droplet Hostname droplet_ip User user IdentityFile ~/.ssh/id_user_rsa

Now connect using this command ssh user_droplet

Hope this helps, revert back to me if you needed more help.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Popular Topics

  • Ubuntu
  • Linux Basics
  • JavaScript
  • Python
  • MySQL
  • Docker
  • Kubernetes
  • All tutorials
  • Talk to an expert

Featured on Community

New SSH key for a new different user | DigitalOcean (2)

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up

New SSH key for a new different user | DigitalOcean (3)

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Learn more

New SSH key for a new different user | DigitalOcean (4)

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Learn more

Featured Tutorials

Kubernetes CourseLearn Python 3Machine Learning in PythonGetting started with GoIntro to Kubernetes

DigitalOcean Products

App PlatformVirtual MachinesManaged DatabasesManaged KubernetesBlock StorageObject StorageMarketplaceVPCLoad Balancers

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more

© 2024 DigitalOcean, LLC.Sitemap.

New SSH key for a new different user | DigitalOcean (2024)
Top Articles
Funding An Employee Stock Option Purchase: Understanding A Cash Exercise and Cashless Exercise
Home Loan - Apply for Home Loan in India | HDFC Bank
Golden Abyss - Chapter 5 - Lunar_Angel
Sprinter Tyrone's Unblocked Games
Erika Kullberg Wikipedia
Overnight Cleaner Jobs
Davante Adams Wikipedia
Aiken County government, school officials promote penny tax in North Augusta
Urinevlekken verwijderen: De meest effectieve methoden - Puurlv
Raid Guides - Hardstuck
O'reilly's Auto Parts Closest To My Location
TS-Optics ToupTek Color Astro Camera 2600CP Sony IMX571 Sensor D=28.3 mm-TS2600CP
Clarksburg Wv Craigslist Personals
Connect U Of M Dearborn
Katherine Croan Ewald
Best Uf Sororities
Healthier Homes | Coronavirus Protocol | Stanley Steemer - Stanley Steemer | The Steem Team
Teacup Yorkie For Sale Up To $400 In South Carolina
Bernie Platt, former Cherry Hill mayor and funeral home magnate, has died at 90
Barber Gym Quantico Hours
Wbiw Weather Watchers
Ford F-350 Models Trim Levels and Packages
Xfinity Outage Map Fredericksburg Va
Best Sports Bars In Schaumburg Il
Boise Craigslist Cars And Trucks - By Owner
Lexus Credit Card Login
Times Narcos Lied To You About What Really Happened - Grunge
4.231 Rounded To The Nearest Hundred
Florence Y'alls Standings
Used 2 Seater Go Karts
Gasbuddy Lenoir Nc
The Pretty Kitty Tanglewood
Junee Warehouse | Imamother
Cvb Location Code Lookup
Edict Of Force Poe
Are you ready for some football? Zag Alum Justin Lange Forges Career in NFL
Instafeet Login
Gets Less Antsy Crossword Clue
Tokyo Spa Memphis Reviews
Craigslist Gigs Wichita Ks
Felix Mallard Lpsg
11301 Lakeline Blvd Parkline Plaza Ctr Ste 150
Entry of the Globbots - 20th Century Electro​-​Synthesis, Avant Garde & Experimental Music 02;31,​07 - Volume II, by Various
Cpmc Mission Bernal Campus & Orthopedic Institute Photos
Pain Out Maxx Kratom
Hk Jockey Club Result
Avatar: The Way Of Water Showtimes Near Jasper 8 Theatres
Okta Login Nordstrom
Barber Gym Quantico Hours
Fallout 76 Fox Locations
Craigslist Cars And Trucks For Sale By Owner Indianapolis
Latest Posts
Article information

Author: Rob Wisoky

Last Updated:

Views: 6173

Rating: 4.8 / 5 (48 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Rob Wisoky

Birthday: 1994-09-30

Address: 5789 Michel Vista, West Domenic, OR 80464-9452

Phone: +97313824072371

Job: Education Orchestrator

Hobby: Lockpicking, Crocheting, Baton twirling, Video gaming, Jogging, Whittling, Model building

Introduction: My name is Rob Wisoky, I am a smiling, helpful, encouraging, zealous, energetic, faithful, fantastic person who loves writing and wants to share my knowledge and understanding with you.